Class: Journey::Nodes::Node
- Inherits:
-
Object
- Object
- Journey::Nodes::Node
show all
- Includes:
- Enumerable
- Defined in:
- lib/journey/nodes/node.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(left) ⇒ Node
Returns a new instance of Node.
10
11
12
13
|
# File 'lib/journey/nodes/node.rb', line 10
def initialize left
@left = left
@memo = nil
end
|
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
8
9
10
|
# File 'lib/journey/nodes/node.rb', line 8
def left
@left
end
|
#memo ⇒ Object
Returns the value of attribute memo.
8
9
10
|
# File 'lib/journey/nodes/node.rb', line 8
def memo
@memo
end
|
Instance Method Details
#each(&block) ⇒ Object
15
16
17
|
# File 'lib/journey/nodes/node.rb', line 15
def each(&block)
Visitors::Each.new(block).accept(self)
end
|
#literal? ⇒ Boolean
40
|
# File 'lib/journey/nodes/node.rb', line 40
def literal?; false; end
|
#name ⇒ Object
31
32
33
|
# File 'lib/journey/nodes/node.rb', line 31
def name
left.tr ':', ''
end
|
#symbol? ⇒ Boolean
39
|
# File 'lib/journey/nodes/node.rb', line 39
def symbol?; false; end
|
#to_sym ⇒ Object
27
28
29
|
# File 'lib/journey/nodes/node.rb', line 27
def to_sym
name.to_sym
end
|
#type ⇒ Object
35
36
37
|
# File 'lib/journey/nodes/node.rb', line 35
def type
raise NotImplementedError
end
|