Module: Draper::Decoratable::Equality
- Included in:
- Draper::Decoratable
- Defined in:
- lib/draper/decoratable/equality.rb
Class Method Summary collapse
-
.test(object, other) ⇒ Boolean
Compares an object to a possibly-decorated object.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares self with a possibly-decorated object.
Class Method Details
.test(object, other) ⇒ Boolean
Compares an object to a possibly-decorated object.
14 15 16 17 |
# File 'lib/draper/decoratable/equality.rb', line 14 def self.test(object, other) return object == other if object.is_a?(Decoratable) object == other || test_for_decorator(object, other) end |
Instance Method Details
#==(other) ⇒ Boolean
Compares self with a possibly-decorated object.
7 8 9 |
# File 'lib/draper/decoratable/equality.rb', line 7 def ==(other) super || Equality.test_for_decorator(self, other) end |