Class: Refract::LocalVariableOrWriteNode

Inherits:
Node
  • Object
show all
Defined in:
lib/refract/nodes/local_variable_or_write_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept, #copy, #start_line, #type, type

Constructor Details

#initialize(prism_node: nil, name:, value:, depth:) ⇒ LocalVariableOrWriteNode

Returns a new instance of LocalVariableOrWriteNode.



5
6
7
8
9
10
11
# File 'lib/refract/nodes/local_variable_or_write_node.rb', line 5

def initialize(prism_node: nil, name:, value:, depth:)
  @prism_node = prism_node => Prism::Node | nil
  @name = name
  @value = value
  @depth = depth
  freeze
end

Instance Attribute Details

#depthObject

Returns the value of attribute depth.



13
14
15
# File 'lib/refract/nodes/local_variable_or_write_node.rb', line 13

def depth
  @depth
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/refract/nodes/local_variable_or_write_node.rb', line 13

def name
  @name
end

#valueObject

Returns the value of attribute value.



13
14
15
# File 'lib/refract/nodes/local_variable_or_write_node.rb', line 13

def value
  @value
end