Skip to content

Commit

Permalink
This works...with my slight changes to the SortedTree constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrick Wiebe committed Oct 3, 2013
1 parent 7714389 commit ce63def
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/pacer-neo4j/collections/sorted_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ def insert(v)
alias add_node insert

def leaves(*exts)
iterator.to_route.
map(graph: graph, element_type: :vertex, extensions: exts) { |n| neo_vertex n }
to_route.map(graph: graph, element_type: :vertex, extensions: exts) { |n| neo_vertex n }
end
end
end

module SortedTree
def self.route(r)
r.v.lookahead { |v| v.out_e(:TREE_ROOT) }
end

module Graph
def create_unique_sorted_tree(name, key)
t = Pacer::Neo4j::Collections::SortedTree.new self, key, true, name
Expand All @@ -97,17 +100,18 @@ module Vertex
include Pacer::Neo4j::Algo::Wrapping

def sorted_tree_impl
@sorted_tree ||= SortedTree.new self
@sorted_tree ||= Pacer::Neo4j::Collections::SortedTree.new self
end

def leaves(*exts)
sorted_tree_impl.leaves(graph, *exts)
sorted_tree_impl.leaves(*exts)
end

def insert(v)
sorted_tree_impl.insert v
end
end

end

class Graph
Expand Down

0 comments on commit ce63def

Please sign in to comment.