Class: Spoom::Sorbet::Assertions::AssignNode

Inherits:
Object
  • Object
show all
Defined in:
lib/spoom/sorbet/assertions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, operator_loc, value, type) ⇒ AssignNode

: (AssignType, Prism::Location, Prism::Node, Prism::Node) -> void



133
134
135
136
137
138
# File 'lib/spoom/sorbet/assertions.rb', line 133

def initialize(node, operator_loc, value, type)
  @node = node
  @operator_loc = operator_loc
  @value = value
  @type = type
end

Instance Attribute Details

#nodeObject (readonly)

: AssignType



124
125
126
# File 'lib/spoom/sorbet/assertions.rb', line 124

def node
  @node
end

#operator_locObject (readonly)

: Prism::Location



127
128
129
# File 'lib/spoom/sorbet/assertions.rb', line 127

def operator_loc
  @operator_loc
end

#typeObject (readonly)

: Prism::Node



130
131
132
# File 'lib/spoom/sorbet/assertions.rb', line 130

def type
  @type
end

#valueObject (readonly)

: Prism::Node



130
131
132
# File 'lib/spoom/sorbet/assertions.rb', line 130

def value
  @value
end

Instance Method Details

#rbs_typeObject

: -> String



141
142
143
# File 'lib/spoom/sorbet/assertions.rb', line 141

def rbs_type
  RBI::Type.parse_node(type).rbs_string
end