Class: Steep::TypeInference::SendArgs::PositionalArgs::NodeTypePair

Inherits:
Object
  • Object
show all
Includes:
Equatable
Defined in:
lib/steep/type_inference/send_args.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Equatable

#==, #eql?, #hash

Constructor Details

#initialize(node:, type:) ⇒ NodeTypePair

Returns a new instance of NodeTypePair.



25
26
27
28
# File 'lib/steep/type_inference/send_args.rb', line 25

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

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



22
23
24
# File 'lib/steep/type_inference/send_args.rb', line 22

def node
  @node
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#node_typeObject



32
33
34
35
36
37
38
39
# File 'lib/steep/type_inference/send_args.rb', line 32

def node_type
  case node.type
  when :splat
    AST::Builtin::Array.instance_type(type)
  else
    type
  end
end