Class: Refract::ForNode

Inherits:
Node
  • Object
show all
Defined in:
lib/refract/nodes/for_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, index:, collection:, statements:) ⇒ ForNode

Returns a new instance of ForNode.



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

def initialize(prism_node: nil, index:, collection:, statements:)
	@prism_node = prism_node => Prism::Node | nil
	@index = index
	@collection = collection
	@statements = statements
	freeze
end

Instance Attribute Details

#collectionObject

Returns the value of attribute collection.



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

def collection
  @collection
end

#indexObject

Returns the value of attribute index.



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

def index
  @index
end

#statementsObject

Returns the value of attribute statements.



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

def statements
  @statements
end