Class: Eps::Evaluators::Node
- Inherits:
-
Object
- Object
- Eps::Evaluators::Node
- Defined in:
- lib/eps/evaluators/node.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#leaf_index ⇒ Object
Returns the value of attribute leaf_index.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
- #field ⇒ Object
-
#initialize(predicate: nil, score: nil, children: nil, leaf_index: nil) ⇒ Node
constructor
A new instance of Node.
- #operator ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(predicate: nil, score: nil, children: nil, leaf_index: nil) ⇒ Node
Returns a new instance of Node.
6 7 8 9 10 11 |
# File 'lib/eps/evaluators/node.rb', line 6 def initialize(predicate: nil, score: nil, children: nil, leaf_index: nil) @predicate = predicate @children = children || [] @score = score @leaf_index = leaf_index end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
4 5 6 |
# File 'lib/eps/evaluators/node.rb', line 4 def children @children end |
#leaf_index ⇒ Object
Returns the value of attribute leaf_index.
4 5 6 |
# File 'lib/eps/evaluators/node.rb', line 4 def leaf_index @leaf_index end |
#predicate ⇒ Object
Returns the value of attribute predicate.
4 5 6 |
# File 'lib/eps/evaluators/node.rb', line 4 def predicate @predicate end |
#score ⇒ Object
Returns the value of attribute score.
4 5 6 |
# File 'lib/eps/evaluators/node.rb', line 4 def score @score end |
Instance Method Details
#field ⇒ Object
13 14 15 |
# File 'lib/eps/evaluators/node.rb', line 13 def field @predicate[:field] end |
#operator ⇒ Object
17 18 19 |
# File 'lib/eps/evaluators/node.rb', line 17 def operator @predicate[:operator] end |
#value ⇒ Object
21 22 23 |
# File 'lib/eps/evaluators/node.rb', line 21 def value @predicate[:value] end |