Sha256: 3d6bbf81246a46f274a8192726be46cdd4f38936372362d30320d0ad50dc35ce

Contents?: true

Size: 872 Bytes

Versions: 5

Compression:

Stored size: 872 Bytes

Contents

module Neo4j
  module Core
    module Traversal
      # Extends the Neo4j::Core Traverser in order to add rule traversal methods.
      class Traverser
        def filter_method(name, &proc)
          # add method name
          singelton = class << self;
            self;
          end
          singelton.send(:define_method, name) { filter &proc }
          self
        end

        def functions_method(func, rule_node, rule_name)
          singelton = class << self;
            self;
          end
          singelton.send(:define_method, func.class.function_name) do |*args|
            function_id = args.empty? ? "_classname" : args[0]
            function = rule_node.find_function(rule_name, func.class.function_name, function_id)
            function.value(rule_node.rule_node, rule_name)
          end
          self
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neo4j-wrapper-0.0.5-java lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb
neo4j-wrapper-0.0.4-java lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb
neo4j-wrapper-0.0.3-java lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb
neo4j-wrapper-0.0.2-java lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb
neo4j-wrapper-0.0.1-java lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb