Class: Nickel::RecurrenceConstruct
- Defined in:
- lib/nickel/construct.rb
Instance Attribute Summary collapse
-
#repeats ⇒ Object
Returns the value of attribute repeats.
-
#repeats_on ⇒ Object
Returns the value of attribute repeats_on.
Attributes inherited from Construct
#comp_end, #comp_start, #found_in
Instance Method Summary collapse
Methods inherited from Construct
Constructor Details
This class inherits a constructor from Nickel::Construct
Instance Attribute Details
#repeats ⇒ Object
Returns the value of attribute repeats.
36 37 38 |
# File 'lib/nickel/construct.rb', line 36 def repeats @repeats end |
#repeats_on ⇒ Object
Returns the value of attribute repeats_on.
36 37 38 |
# File 'lib/nickel/construct.rb', line 36 def repeats_on @repeats_on end |
Instance Method Details
#get_interval ⇒ Object
52 53 54 55 |
# File 'lib/nickel/construct.rb', line 52 def get_interval warn '[DEPRECATION] `get_interval` is deprecated. Please use `interval` instead.' interval end |
#interpret ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/nickel/construct.rb', line 38 def interpret if [:daily, :altdaily, :threedaily].include?(repeats) interpret_daily_variant elsif [:weekly, :altweekly, :threeweekly].include?(repeats) interpret_weekly_variant elsif [:daymonthly, :altdaymonthly, :threedaymonthly].include?(repeats) interpret_daymonthly_variant elsif [:datemonthly, :altdatemonthly, :threedatemonthly].include?(repeats) interpret_datemonthly_variant else fail StandardError, 'self is an invalid variant, check value of self.repeats' end end |
#interval ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/nickel/construct.rb', line 57 def interval if [:daily, :weekly, :daymonthly, :datemonthly].include?(repeats) 1 elsif [:altdaily, :altweekly, :altdaymonthly, :altdatemonthly].include?(repeats) 2 elsif [:threedaily, :threeweekly, :threedaymonthly, :threedatemonthly].include?(repeats) 3 else fail StandardError, 'self.repeats is invalid!!' end end |