Sha256: 162b55c14e3b760d3b9f716641cbc419edcb908c8f121782ad94179cc7959714

Contents?: true

Size: 556 Bytes

Versions: 26

Compression:

Stored size: 556 Bytes

Contents

module Neo4j
  module Traversal
    class FilterPredicate # :nodoc:
      include org.neo4j.helpers.Predicate
      def initialize
        @procs = []
      end

      def add(proc)
        @procs << proc
      end

      def include_start_node
        @include_start_node = true
      end

      def accept(path)
        return false if @include_start_node && path.length == 0
        # find the first filter which returns false
        # if not found then we will accept this path
        @procs.find {|p| !p.call(path)}.nil?
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
neo4j-1.0.0-java lib/neo4j/traversal/filter_predicate.rb
neo4j-1.0.0.beta.32-java lib/neo4j/traversal/filter_predicate.rb
neo4j-1.0.0.beta.31-java lib/neo4j/traversal/filter_predicate.rb
neo4j-1.0.0.beta.30-java lib/neo4j/traversal/filter_predicate.rb
neo4j-1.0.0.beta.29-java lib/neo4j/traversal/filter_predicate.rb
neo4j-1.0.0.beta.28-java lib/neo4j/traversal/filter_predicate.rb