Class: Conditions::Before
- Inherits:
-
ScheduleCondition
- Object
- Condition
- FieldCondition
- ScheduleCondition
- Conditions::Before
- Defined in:
- lib/triggerable/conditions/schedule/before.rb
Instance Method Summary collapse
Methods inherited from ScheduleCondition
#initialize, #scope, #true_for?
Methods inherited from FieldCondition
#initialize, #scope, #true_for?
Methods inherited from Condition
Constructor Details
This class inherits a constructor from Conditions::ScheduleCondition
Instance Method Details
#from ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/triggerable/conditions/schedule/before.rb', line 3 def from case @math_condition when :greater_than Time.now when :less_than Time.now + @value when nil automation_time + @value end end |
#to ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/triggerable/conditions/schedule/before.rb', line 14 def to case @math_condition when :greater_than Time.now + @value when nil automation_time + @value + Engine.interval end end |