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)


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

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

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

Returns:

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

Returns:

  • (Array)


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

#freezeObject



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

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

#hashObject



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

def hash
  equality_fields.hash
end