Navigation Menu

Skip to content

Commit

Permalink
added an exception to Object#in? to match the methods documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredonline authored and dhh committed Apr 14, 2011
1 parent 89884c1 commit 2db9f8a
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -6,6 +6,7 @@ class Object
# "Konata".in?(characters) # => true
#
def in?(another_object)
raise ArgumentError.new("You must supply another object that responds to include?") unless another_object.respond_to?(:include?)
another_object.include?(self)
end
end

0 comments on commit 2db9f8a

Please sign in to comment.