Class: RazyK::Combinator
- Inherits:
-
Node
- Object
- Node
- RazyK::Combinator
show all
- Defined in:
- lib/razyk/node.rb
Instance Attribute Summary
Attributes inherited from Node
#from, #label, #to
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Node
#as_json, connect, disconnect, #integer, #integer?, list, #replace, #replace_child
Constructor Details
Returns a new instance of Combinator.
94
95
96
|
# File 'lib/razyk/node.rb', line 94
def initialize(comb)
super(comb)
end
|
Class Method Details
.get(comb, mem) ⇒ Object
89
90
91
92
|
# File 'lib/razyk/node.rb', line 89
def self.get(comb, mem)
n = comb.to_s
mem[n] ||= self.new(comb)
end
|
Instance Method Details
#inspect ⇒ Object
106
107
108
|
# File 'lib/razyk/node.rb', line 106
def inspect
to_s
end
|
#to_s ⇒ Object
98
99
100
101
102
103
104
105
|
# File 'lib/razyk/node.rb', line 98
def to_s
case l = @label.to_s
when "S", "K", "I"
l
else
"$" + l
end
end
|