Class: IceCube::InputAlignment

Inherits:
Object
  • Object
show all
Defined in:
lib/ice_cube/input_alignment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, value, rule_part) ⇒ InputAlignment

Returns a new instance of InputAlignment.


4
5
6
7
8
# File 'lib/ice_cube/input_alignment.rb', line 4

def initialize(rule, value, rule_part)
  @rule = rule
  @value = value
  @rule_part = rule_part
end

Instance Attribute Details

#ruleObject (readonly)

Returns the value of attribute rule


10
11
12
# File 'lib/ice_cube/input_alignment.rb', line 10

def rule
  @rule
end

#rule_partObject (readonly)

Returns the value of attribute rule_part


10
11
12
# File 'lib/ice_cube/input_alignment.rb', line 10

def rule_part
  @rule_part
end

#valueObject (readonly)

Returns the value of attribute value


10
11
12
# File 'lib/ice_cube/input_alignment.rb', line 10

def value
  @value
end

Instance Method Details

#verify(freq, options = {}, &block) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ice_cube/input_alignment.rb', line 12

def verify(freq, options={}, &block)
  @rule.validations[:interval] or return

  case @rule
  when DailyRule
    verify_wday_alignment(freq, &block)
  when MonthlyRule
    verify_month_alignment(freq, &block)
  else
    verify_freq_alignment(freq, &block)
  end
end