Class: IceCubeEx::Validations::DayCycleInterval::Validation
- Inherits:
-
IceCube::Validations::DailyInterval::Validation
- Object
- IceCube::Validations::DailyInterval::Validation
- IceCubeEx::Validations::DayCycleInterval::Validation
- Defined in:
- lib/ice_cube_ex/validations/day_cycle_interval.rb
Instance Attribute Summary collapse
-
#cycle ⇒ Object
readonly
Returns the value of attribute cycle.
-
#skip ⇒ Object
readonly
Returns the value of attribute skip.
Instance Method Summary collapse
- #build_hash(builder) ⇒ Object
- #build_ical(builder) ⇒ Object
- #build_s(builder) ⇒ Object
-
#initialize(interval, cycle, skip) ⇒ Validation
constructor
A new instance of Validation.
Constructor Details
#initialize(interval, cycle, skip) ⇒ Validation
Returns a new instance of Validation.
28 29 30 31 32 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 28 def initialize(interval, cycle, skip) super(interval) @cycle = cycle @skip = skip end |
Instance Attribute Details
#cycle ⇒ Object (readonly)
Returns the value of attribute cycle.
26 27 28 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 26 def cycle @cycle end |
#skip ⇒ Object (readonly)
Returns the value of attribute skip.
26 27 28 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 26 def skip @skip end |
Instance Method Details
#build_hash(builder) ⇒ Object
38 39 40 41 42 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 38 def build_hash(builder) builder[:interval] = interval builder[:cycle] = cycle builder[:skip] = skip end |
#build_ical(builder) ⇒ Object
44 45 46 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 44 def build_ical(builder) builder['FREQ'] << 'DAY_CYCLE (CUSTOM RULE)' end |
#build_s(builder) ⇒ Object
34 35 36 |
# File 'lib/ice_cube_ex/validations/day_cycle_interval.rb', line 34 def build_s(builder) builder.base = "Every #{cycle} days, skip #{skip} times" end |