Class: SyntaxTree::Bf::Loop
Overview
- …
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(nodes:, location:) ⇒ Loop
constructor
A new instance of Loop.
Methods inherited from Node
Constructor Details
#initialize(nodes:, location:) ⇒ Loop
Returns a new instance of Loop.
43 44 45 46 |
# File 'lib/syntax_tree/bf/nodes.rb', line 43 def initialize(nodes:, location:) @nodes = nodes @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
41 42 43 |
# File 'lib/syntax_tree/bf/nodes.rb', line 41 def location @location end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
41 42 43 |
# File 'lib/syntax_tree/bf/nodes.rb', line 41 def nodes @nodes end |
Instance Method Details
#accept(visitor) ⇒ Object
48 49 50 |
# File 'lib/syntax_tree/bf/nodes.rb', line 48 def accept(visitor) visitor.visit_loop(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
52 53 54 |
# File 'lib/syntax_tree/bf/nodes.rb', line 52 def child_nodes nodes end |
#deconstruct_keys(keys) ⇒ Object
58 59 60 |
# File 'lib/syntax_tree/bf/nodes.rb', line 58 def deconstruct_keys(keys) { nodes: nodes, location: location } end |