Class: Factbase::ToTime
- Inherits:
-
TermBase
- Object
- TermBase
- Factbase::ToTime
- Defined in:
- lib/factbase/terms/to_time.rb
Overview
Represents a string conversion term 'to_time'. This class is used to evaluate a term and return its time representation.
Instance Method Summary collapse
-
#evaluate(fact, maps, fb) ⇒ Time
Evaluate term on a fact.
-
#initialize(operands) ⇒ ToTime
constructor
Constructor.
Constructor Details
#initialize(operands) ⇒ ToTime
Constructor.
12 13 14 15 |
# File 'lib/factbase/terms/to_time.rb', line 12 def initialize(operands) super() @operands = operands end |
Instance Method Details
#evaluate(fact, maps, fb) ⇒ Time
Evaluate term on a fact.
22 23 24 25 26 27 |
# File 'lib/factbase/terms/to_time.rb', line 22 def evaluate(fact, maps, fb) assert_args(1) vv = _values(0, fact, maps, fb) return if vv.nil? parse(vv[0]) end |