Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/is_same/core_ext/core_ext.rb,
lib/is_same/core_ext/core_ext.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
109 110 111 |
# File 'lib/is_same/core_ext/core_ext.rb', line 109 def is_same? object matching? object end |
#matching?(object = nil, &block) ⇒ Boolean
2 3 4 5 6 7 8 9 |
# File 'lib/is_same/core_ext/core_ext.rb', line 2 def matching? object=nil, &block if object.is_a?(Proc) or block object ||= block object.call(self) else self == object end end |