Class: SyntaxTree::Bf::Decrement

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:) ⇒ Decrement

Returns a new instance of Decrement.



90
91
92
# File 'lib/syntax_tree/bf/nodes.rb', line 90

def initialize(location:)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



88
89
90
# File 'lib/syntax_tree/bf/nodes.rb', line 88

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



94
95
96
# File 'lib/syntax_tree/bf/nodes.rb', line 94

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

#child_nodesObject Also known as: deconstruct



98
99
100
# File 'lib/syntax_tree/bf/nodes.rb', line 98

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



104
105
106
# File 'lib/syntax_tree/bf/nodes.rb', line 104

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