module Draper::Decoratable::Equality
Public Class Methods
Source
# 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
Compares an object to a possibly-decorated object.
@return [Boolean]
Source
# File lib/draper/decoratable/equality.rb, line 20 def self.test_for_decorator(object, other) other.respond_to?(:decorated?) && other.decorated? && other.respond_to?(:object) && test(object, other.object) end
@private
Public Instance Methods
Source
# File lib/draper/decoratable/equality.rb, line 7 def ==(other) super || Equality.test_for_decorator(self, other) end
Compares self with a possibly-decorated object.
@return [Boolean]
Calls superclass method