Class: Conditions::After

Inherits:
ScheduleCondition show all
Defined in:
lib/triggerable/conditions/schedule/after.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

build, #scope, #true_for?

Constructor Details

This class inherits a constructor from Conditions::ScheduleCondition

Instance Method Details

#fromObject



3
4
5
6
7
8
9
10
# File 'lib/triggerable/conditions/schedule/after.rb', line 3

def from
  case @math_condition
  when :greater_than, :less_than
    Time.now - @value
  when nil
    automation_time - @value - Engine.interval
  end
end

#toObject



12
13
14
# File 'lib/triggerable/conditions/schedule/after.rb', line 12

def to
  automation_time - @value
end