Sha256: 13fa1d539db0a755739cbb73de56d1bcd20dd555140bc854a734997e1695b3a7

Contents?: true

Size: 813 Bytes

Versions: 26

Compression:

Stored size: 813 Bytes

Contents

module Neo4j
  module Rule
    module Functions

      class Sum < Function
        # Updates the function's value.
        # Called after the transactions commits and a property has been changed on a node.
        #
        # ==== Arguments
        # * rule_name :: the name of the rule group
        # * rule_node :: the node which contains the value of this function
        # * old_value new value :: the changed value of the property (when the transaction commits)
        def update(rule_name, rule_node, old_value, new_value)
          key = rule_node_property(rule_name)
          rule_node[key] ||= 0
          old_value ||= 0
          new_value ||= 0
          rule_node[key] += new_value - old_value
        end

        def self.function_name
          :sum
        end
      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/rule/functions/sum.rb
neo4j-2.0.0.alpha.4-java lib/neo4j/rule/functions/sum.rb
neo4j-2.0.0.alpha.3-java lib/neo4j/rule/functions/sum.rb
neo4j-1.3.1-java lib/neo4j/rule/functions/sum.rb
neo4j-1.3.0-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.6-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.5-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.4-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.3-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.2-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.1-java lib/neo4j/rule/functions/sum.rb
neo4j-1.2.0-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.4-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.3-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.2-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.1-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.0-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.0.beta.3-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.0.beta.2-java lib/neo4j/rule/functions/sum.rb
neo4j-1.1.0.beta.1-java lib/neo4j/rule/functions/sum.rb