Module: Solargraph::Equality Abstract
- Included in:
- ComplexType, ComplexType::UniqueType, Location, Position, Range, Source::Chain, Source::Chain::Link
- Defined in:
- lib/solargraph/equality.rb
Overview
This module is abstract.
This mixin relies on these - methods:
equality_fields()
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #equality_fields ⇒ Array
- #freeze ⇒ Object
- #hash ⇒ Object
Instance Method Details
#==(other) ⇒ Boolean
20 21 22 |
# File 'lib/solargraph/equality.rb', line 20 def ==(other) self.eql?(other) end |
#eql?(other) ⇒ Boolean
13 14 15 16 |
# File 'lib/solargraph/equality.rb', line 13 def eql?(other) self.class.eql?(other.class) && equality_fields.eql?(other.equality_fields) end |
#equality_fields ⇒ Array
|
# File 'lib/solargraph/equality.rb', line 8
|
#freeze ⇒ Object
28 29 30 31 |
# File 'lib/solargraph/equality.rb', line 28 def freeze equality_fields.each(&:freeze) super end |
#hash ⇒ Object
24 25 26 |
# File 'lib/solargraph/equality.rb', line 24 def hash equality_fields.hash end |