Module: Corefines::Object::In
- Defined in:
- lib/corefines/object.rb
Instance Method Summary collapse
-
#in?(other) ⇒ Boolean
trueif this object is included in the other object,falseotherwise.
Instance Method Details
#in?(other) ⇒ Boolean
Returns true if this object is included in the other
object, false otherwise.
164 165 166 167 168 169 170 171 172 |
# File 'lib/corefines/object.rb', line 164 module In refine ::Object do def in?(other) other.include? self rescue NoMethodError fail ArgumentError, "The parameter passed to #in? must respond to #include?" end end end |