Class: Steep::TypeInference::BlockParams::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/type_inference/block_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(var:, type:, value:, node:) ⇒ Param

Returns a new instance of Param.



10
11
12
13
14
15
# File 'lib/steep/type_inference/block_params.rb', line 10

def initialize(var:, type:, value:, node:)
  @var = var
  @type = type
  @value = value
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



8
9
10
# File 'lib/steep/type_inference/block_params.rb', line 8

def node
  @node
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/steep/type_inference/block_params.rb', line 6

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/steep/type_inference/block_params.rb', line 7

def value
  @value
end

#varObject (readonly)

Returns the value of attribute var.



5
6
7
# File 'lib/steep/type_inference/block_params.rb', line 5

def var
  @var
end

Instance Method Details

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



17
18
19
# File 'lib/steep/type_inference/block_params.rb', line 17

def ==(other)
  other.is_a?(self.class) && other.var == var && other.type == type && other.value == value && other.node == node
end

#hashObject



23
24
25
# File 'lib/steep/type_inference/block_params.rb', line 23

def hash
  self.class.hash ^ var.hash ^ type.hash ^ value.hash ^ node.hash
end