Sha256: f9a4bd4aad0697c3d3cb861c251cde492c47698f152da1b3c4eeec6fc6556c6e

Contents?: true

Size: 509 Bytes

Versions: 13

Compression:

Stored size: 509 Bytes

Contents

module Eps
  module Evaluators
    class Node
      attr_accessor :score, :predicate, :children, :leaf_index

      def initialize(predicate: nil, score: nil, children: nil, leaf_index: nil)
        @predicate = predicate
        @children = children || []
        @score = score
        @leaf_index = leaf_index
      end

      def field
        @predicate[:field]
      end

      def operator
        @predicate[:operator]
      end

      def value
        @predicate[:value]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
eps-0.5.0 lib/eps/evaluators/node.rb
eps-0.4.1 lib/eps/evaluators/node.rb
eps-0.4.0 lib/eps/evaluators/node.rb
eps-0.3.9 lib/eps/evaluators/node.rb
eps-0.3.8 lib/eps/evaluators/node.rb
eps-0.3.7 lib/eps/evaluators/node.rb
eps-0.3.6 lib/eps/evaluators/node.rb
eps-0.3.5 lib/eps/evaluators/node.rb
eps-0.3.4 lib/eps/evaluators/node.rb
eps-0.3.3 lib/eps/evaluators/node.rb
eps-0.3.2 lib/eps/evaluators/node.rb
eps-0.3.1 lib/eps/evaluators/node.rb
eps-0.3.0 lib/eps/evaluators/node.rb