Class: CArray::Fusion::Walk
- Inherits:
-
Object
- Object
- CArray::Fusion::Walk
- Defined in:
- lib/carray/fusion.rb
Overview
---- the walk -------------------------------------------------------
Instance Attribute Summary collapse
-
#leaves ⇒ Object
readonly
Returns the value of attribute leaves.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
Instance Method Summary collapse
-
#initialize ⇒ Walk
constructor
A new instance of Walk.
- #visit(n) ⇒ Object
Constructor Details
#initialize ⇒ Walk
Returns a new instance of Walk.
131 132 133 134 135 136 |
# File 'lib/carray/fusion.rb', line 131 def initialize @nodes = [] @leaves = [] @seen = {} @signature = +"" end |
Instance Attribute Details
#leaves ⇒ Object (readonly)
Returns the value of attribute leaves.
129 130 131 |
# File 'lib/carray/fusion.rb', line 129 def leaves @leaves end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
129 130 131 |
# File 'lib/carray/fusion.rb', line 129 def nodes @nodes end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
129 130 131 |
# File 'lib/carray/fusion.rb', line 129 def signature @signature end |
Instance Method Details
#visit(n) ⇒ Object
138 139 140 |
# File 'lib/carray/fusion.rb', line 138 def visit (n) @seen[n.object_id] ||= build(n) end |