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
21 22 23 |
# File 'lib/solargraph/equality.rb', line 21 def ==(other) self.eql?(other) end |
#eql?(other) ⇒ Boolean
13 14 15 16 17 |
# File 'lib/solargraph/equality.rb', line 13 def eql?(other) self.class.eql?(other.class) && # @sg-ignore https://github.com/castwide/solargraph/pull/1114 equality_fields.eql?(other.equality_fields) end |
#equality_fields ⇒ Array
|
|
# File 'lib/solargraph/equality.rb', line 8
|
#freeze ⇒ Object
29 30 31 32 |
# File 'lib/solargraph/equality.rb', line 29 def freeze equality_fields.each(&:freeze) super end |
#hash ⇒ Object
25 26 27 |
# File 'lib/solargraph/equality.rb', line 25 def hash equality_fields.hash end |