Class: SyntaxTree::Bf::Increment
- Defined in:
- lib/syntax_tree/bf/nodes.rb
Overview
+
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location:) ⇒ Increment
constructor
A new instance of Increment.
Methods inherited from Node
Constructor Details
#initialize(location:) ⇒ Increment
Returns a new instance of Increment.
67 68 69 |
# File 'lib/syntax_tree/bf/nodes.rb', line 67 def initialize(location:) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
65 66 67 |
# File 'lib/syntax_tree/bf/nodes.rb', line 65 def location @location end |
Instance Method Details
#accept(visitor) ⇒ Object
71 72 73 |
# File 'lib/syntax_tree/bf/nodes.rb', line 71 def accept(visitor) visitor.visit_increment(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
75 76 77 |
# File 'lib/syntax_tree/bf/nodes.rb', line 75 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
81 82 83 |
# File 'lib/syntax_tree/bf/nodes.rb', line 81 def deconstruct_keys(keys) { value: "+", location: location } end |