Sha256: 7e18538477b3743655a42bd640c0c969c0f85d329654abbd89f3fdb120057536

Contents?: true

Size: 700 Bytes

Versions: 4

Compression:

Stored size: 700 Bytes

Contents

module Neo4j
  module Functions
    class Count < Function
      def initialize
        @property = '_classname'
      end

      def calculate?(changed_property)
        true
      end

      def delete(rule_name, rule_node, old_value)
        key            = rule_node_property(rule_name)
        rule_node[key] ||= 0
        rule_node[key] -= 1
      end

      def add(rule_name, rule_node, new_value)
        key            = rule_node_property(rule_name)
        rule_node[key] ||= 0
        rule_node[key] += 1
      end

      def update(*)
        # we are only counting, not interested in property changes
      end

      def self.function_name
        :count
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
neo4j-1.0.0.beta.27-java lib/neo4j/functions/count.rb
neo4j-1.0.0.beta.26-java lib/neo4j/functions/count.rb
neo4j-1.0.0.beta.25-java lib/neo4j/functions/count.rb
neo4j-1.0.0.beta.24-java lib/neo4j/functions/count.rb