Module: IceCube::English::ScheduleExtension
- Included in:
- Schedule
- Defined in:
- lib/ice_cube/english/schedule_extension.rb
Instance Method Summary collapse
-
#add_exception_rule_with_english(rule_or_english) ⇒ Object
Add the specified rule to the Schedule as a exception rule.
-
#add_recurrence_rule_with_english(rule_or_english) ⇒ Object
Add the specified rule to the Schedule as a recurrence rule.
Instance Method Details
#add_exception_rule_with_english(rule_or_english) ⇒ Object
Add the specified rule to the Schedule as a exception rule. The rule may be a Rule object, or it may be an english String.
21 22 23 24 25 26 27 28 |
# File 'lib/ice_cube/english/schedule_extension.rb', line 21 def add_exception_rule_with_english(rule_or_english) return add_exception_rule_without_english(rule_or_english) unless rule_or_english.is_a?(String) rules = ::IceCube::Rule.from_english(rule_or_english, :multiple=>true) rules.each do |rule| add_exception_rule(rule) end self end |
#add_recurrence_rule_with_english(rule_or_english) ⇒ Object
Add the specified rule to the Schedule as a recurrence rule. The rule may be a Rule object, or it may be an english String.
10 11 12 13 14 15 16 17 |
# File 'lib/ice_cube/english/schedule_extension.rb', line 10 def add_recurrence_rule_with_english(rule_or_english) return add_recurrence_rule_without_english(rule_or_english) unless rule_or_english.is_a?(String) rules = ::IceCube::Rule.from_english(rule_or_english, :multiple=>true) rules.each do |rule| add_recurrence_rule(rule) end self end |