Class: Factbase::StartsWith
- Defined in:
- lib/factbase/terms/starts_with.rb
Overview
Represents a ‘starts_with’ term in the Factbase. Returns true if any value of the left operand starts with any value of the right.
Instance Method Summary collapse
-
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
-
#initialize(operands) ⇒ StartsWith
constructor
Constructor.
Methods inherited from TermBase
Constructor Details
#initialize(operands) ⇒ StartsWith
Constructor.
14 15 16 17 |
# File 'lib/factbase/terms/starts_with.rb', line 14 def initialize(operands) super() @op = Factbase::Compare.new(:start_with?, operands) end |
Instance Method Details
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
24 25 26 |
# File 'lib/factbase/terms/starts_with.rb', line 24 def evaluate(fact, maps, fb) @op.evaluate(fact, maps, fb) end |