lib/d3.rb in rubrowser-0.1.5 vs lib/d3.rb in rubrowser-0.1.6
- old
+ new
@@ -22,10 +22,10 @@
end.reduce(:+).to_a.push({ name: node.name, id: node.id })
end
def node_occurences(node)
occurences = []
- occurences += node.children.map { |n| node_occurences(n) }.reduce(:+).to_a
+ occurences += node.children.map { |n| node_occurences(n) }.reduce([], :+)
occurences += node.occurences.map { |n| {source: node.id, target: n.id } }.to_a
occurences
end
end