Class: Conditions::ScheduleCondition

Inherits:
FieldCondition show all
Defined in:
lib/triggerable/conditions/schedule/schedule_condition.rb

Direct Known Subclasses

After, Before

Instance Method Summary collapse

Methods inherited from Condition

build

Constructor Details

#initialize(field, value) ⇒ ScheduleCondition

Returns a new instance of ScheduleCondition.



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

def initialize field, value
  super
  if value.is_a?(Hash)
    @math_condition = value.keys.first
    @value = value.values.first
  end
end

Instance Method Details

#scope(table) ⇒ Object



15
16
17
# File 'lib/triggerable/conditions/schedule/schedule_condition.rb', line 15

def scope table
  condition.scope(table)
end

#true_for?(object) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/triggerable/conditions/schedule/schedule_condition.rb', line 11

def true_for? object
  condition.true_for?(object)
end