Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/is_same/core_ext/object.rb,
lib/is_same/core_ext/backward_compliability/object.rb
Instance Method Summary collapse
-
#is_same?(object) ⇒ Boolean
For backward compliability.
- #matching?(object = nil, &block) ⇒ Boolean
Instance Method Details
#is_same?(object) ⇒ Boolean
For backward compliability
3 4 5 |
# File 'lib/is_same/core_ext/backward_compliability/object.rb', line 3 def is_same?(object) matching? object end |
#matching?(object = nil, &block) ⇒ Boolean
3 4 5 6 7 8 9 10 |
# File 'lib/is_same/core_ext/object.rb', line 3 def matching?(object=nil, &block) if object.is_a?(Proc) or block object ||= block object.call(self) else self == object end end |