Class: CArray::Fusion::Walk

Inherits:
Object
  • Object
show all
Defined in:
lib/carray/fusion.rb

Overview

---- the walk -------------------------------------------------------

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWalk

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

#leavesObject (readonly)

Returns the value of attribute leaves.



129
130
131
# File 'lib/carray/fusion.rb', line 129

def leaves
  @leaves
end

#nodesObject (readonly)

Returns the value of attribute nodes.



129
130
131
# File 'lib/carray/fusion.rb', line 129

def nodes
  @nodes
end

#signatureObject (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