Class: IceCube::SingleOccurrenceRule
- Defined in:
- lib/ice_cube/single_occurrence_rule.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(time) ⇒ SingleOccurrenceRule
constructor
A new instance of SingleOccurrenceRule.
- #next_time(t, schedule, closing_time) ⇒ Object
-
#terminating? ⇒ Boolean
Always terminating.
- #to_hash ⇒ Object
Methods inherited from Rule
#==, daily, from_hash, from_ical, from_yaml, #full_required?, #hash, hourly, minutely, monthly, #on?, #reset, secondly, #to_ical, #to_yaml, weekly, yearly
Constructor Details
#initialize(time) ⇒ SingleOccurrenceRule
Returns a new instance of SingleOccurrenceRule.
7 8 9 |
# File 'lib/ice_cube/single_occurrence_rule.rb', line 7 def initialize(time) @time = time end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/ice_cube/single_occurrence_rule.rb', line 5 def time @time end |
Instance Method Details
#next_time(t, schedule, closing_time) ⇒ Object
16 17 18 19 20 |
# File 'lib/ice_cube/single_occurrence_rule.rb', line 16 def next_time(t, schedule, closing_time) unless closing_time && closing_time < t time if time >= t end end |
#terminating? ⇒ Boolean
Always terminating
12 13 14 |
# File 'lib/ice_cube/single_occurrence_rule.rb', line 12 def terminating? true end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/ice_cube/single_occurrence_rule.rb', line 22 def to_hash { :time => time } end |