Class: SyntaxTree::Bf::Output

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/bf/nodes.rb

Overview

.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ Output

Returns a new instance of Output.



182
183
184
# File 'lib/syntax_tree/bf/nodes.rb', line 182

def initialize(location:)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



180
181
182
# File 'lib/syntax_tree/bf/nodes.rb', line 180

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



186
187
188
# File 'lib/syntax_tree/bf/nodes.rb', line 186

def accept(visitor)
  visitor.visit_output(self)
end

#child_nodesObject Also known as: deconstruct



190
191
192
# File 'lib/syntax_tree/bf/nodes.rb', line 190

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



196
197
198
# File 'lib/syntax_tree/bf/nodes.rb', line 196

def deconstruct_keys(keys)
  { value: ".", location: location }
end