Class: Steep::LocatedValue

Inherits:
Object show all
Defined in:
lib/steep/located_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, location:) ⇒ LocatedValue

Returns a new instance of LocatedValue.



5
6
7
8
# File 'lib/steep/located_value.rb', line 5

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



3
4
5
# File 'lib/steep/located_value.rb', line 3

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/steep/located_value.rb', line 3

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



10
11
12
# File 'lib/steep/located_value.rb', line 10

def ==(other)
  other.is_a?(LocatedValue) && other.value == value
end

#hashObject



16
17
18
# File 'lib/steep/located_value.rb', line 16

def hash
  value.hash # steep:ignore NoMethod
end