Sha256: 2a5a9d0b3ad7d97b71234cfc998ebd8733fde3388b3146b2e33f80b47bd7d2fd
Contents?: true
Size: 599 Bytes
Versions: 10
Compression:
Stored size: 599 Bytes
Contents
# Backported from ActiveSupport 3.1. Should be removed once the 3.1 # version is out. class Object # Returns true if this object is included in the argument. Argument must be # any object which responds to +#include?+. Usage: # # characters = ["Konata", "Kagami", "Tsukasa"] # "Konata".in?(characters) # => true # # This will throw an ArgumentError if the argument doesn't respond # to +#include?+. def in?(another_object) another_object.include?(self) rescue NoMethodError raise ArgumentError.new("The parameter passed to #in? must respond to #include?") end end
Version data entries
10 entries across 10 versions & 1 rubygems