提交 2db9f8a4 编写于 作者: J Jared McFarland 提交者: David Heinemeier Hansson

added an exception to Object#in? to match the methods documentation

上级 89884c19
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册