Module: ThinModels::Struct::IdentityMethods
- Defined in:
- lib/thin_models/struct/identity.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#eql?(other) ⇒ Boolean
this was: alias :eql? :==, but that ran into redmine.ruby-lang.org/issues/show/734.
- #hash ⇒ Object
Instance Method Details
#==(other) ⇒ Object
6 7 8 |
# File 'lib/thin_models/struct/identity.rb', line 6 def ==(other) super || (other.is_a?(self.class) && (id = self.id) && other.id == id) || false end |
#eql?(other) ⇒ Boolean
this was: alias :eql? :==, but that ran into redmine.ruby-lang.org/issues/show/734
15 16 17 |
# File 'lib/thin_models/struct/identity.rb', line 15 def eql?(other) super || (other.is_a?(self.class) && (id = self.id) && other.id == id) || false end |
#hash ⇒ Object
10 11 12 |
# File 'lib/thin_models/struct/identity.rb', line 10 def hash id ? id.hash : super end |