Sha256: 4a6dbd0138920bf93f7828161e514296a85575e0128cf940ba8b70a2d946a2a0
Contents?: true
Size: 676 Bytes
Versions: 5
Compression:
Stored size: 676 Bytes
Contents
module Cadet class RelationshipTraverser include Enumerable include_package "org.neo4j.graphdb" def initialize(node, direction, type) @node = node @type = type @direction = direction @relationships = node.get_relationships(direction, DynamicRelationshipType.withName(type)) end def each @relationships.each do |rel| yield Node.new rel.getOtherNode(@node.node) end end def << (othernode) if @direction == Direction::OUTGOING @node.create_outgoing othernode, @type elsif @direction == Direction::INCOMING othernode.create_outgoing @node, @type end end end end
Version data entries
5 entries across 5 versions & 1 rubygems