Sha256: 60cb1b26dee9fdb95f9a6ae9298f1cbb543684c22f722c142444bad7edada937

Contents?: true

Size: 649 Bytes

Versions: 26

Compression:

Stored size: 649 Bytes

Contents

module Neo4j
  module Traversal
    class RelExpander
      include org.neo4j.graphdb.RelationshipExpander

      attr_accessor :reversed

      def initialize(&block)
        @block = block
        @reverse = false
      end

      def self.create_pair(&block)
        normal = RelExpander.new(&block)
        reversed = RelExpander.new(&block)
        normal.reversed = reversed
        reversed.reversed = normal
        reversed.reverse!
        normal
      end

      def expand(node)
        @block.arity == 1 ? @block.call(node) : @block.call(node, @reverse)
      end

      def reverse!
        @reverse = true
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
neo4j-2.0.0.alpha.5-java lib/neo4j/traversal/rel_expander.rb
neo4j-2.0.0.alpha.4-java lib/neo4j/traversal/rel_expander.rb
neo4j-2.0.0.alpha.3-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.3.1-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.3.0-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.6-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.5-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.4-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.3-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.2-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.1-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.2.0-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.4-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.3-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.2-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.1-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.0-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.0.beta.3-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.0.beta.2-java lib/neo4j/traversal/rel_expander.rb
neo4j-1.1.0.beta.1-java lib/neo4j/traversal/rel_expander.rb