Skip to content

Commit

Permalink
Object#truthy? and Object#to_bool
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Adkisson committed Jul 8, 2010
1 parent 54156c5 commit f947321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/object.rb
Expand Up @@ -18,4 +18,9 @@ def cache_clear(ivar)
def send_to(obj, method, *args)
obj.send(method, self, *args)
end

def truthy?
!!self
end
alias to_bool truthy?
end

0 comments on commit f947321

Please sign in to comment.