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

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

  • other (Object)

Returns:

  • (Boolean)


21
22
23
# File 'lib/solargraph/equality.rb', line 21

def ==(other)
  self.eql?(other)
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

Returns:

  • (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_fieldsArray

Returns:

  • (Array)


# File 'lib/solargraph/equality.rb', line 8


#freezeObject



29
30
31
32
# File 'lib/solargraph/equality.rb', line 29

def freeze
  equality_fields.each(&:freeze)
  super
end

#hashObject



25
26
27
# File 'lib/solargraph/equality.rb', line 25

def hash
  equality_fields.hash
end