Class: RiCal::PropertyValue::OccurrenceList::Enumerator
- Defined in:
- lib/ri_cal/property_value/occurrence_list.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#default_duration ⇒ Object
Returns the value of attribute default_duration.
-
#occurrence_list ⇒ Object
Returns the value of attribute occurrence_list.
Instance Method Summary collapse
- #bounded? ⇒ Boolean
- #empty? ⇒ Boolean
-
#initialize(occurrences, component) ⇒ Enumerator
constructor
TODO: the component parameter should always be the parent.
- #next_occurrence ⇒ Object
Constructor Details
#initialize(occurrences, component) ⇒ Enumerator
TODO: the component parameter should always be the parent
12 13 14 15 16 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 12 def initialize(occurrences, component) # :nodoc: self.occurrence_list = occurrences self.default_duration = component.default_duration @index = 0 end |
Instance Attribute Details
#default_duration ⇒ Object
Returns the value of attribute default_duration.
9 10 11 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 9 def default_duration @default_duration end |
#occurrence_list ⇒ Object
Returns the value of attribute occurrence_list.
9 10 11 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 9 def occurrence_list @occurrence_list end |
Instance Method Details
#bounded? ⇒ Boolean
18 19 20 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 18 def bounded? true end |
#empty? ⇒ Boolean
22 23 24 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 22 def empty? occurrence_list.empty? end |
#next_occurrence ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 26 def next_occurrence if @index < occurrence_list.length result = occurrence_list[@index].occurrence_period(default_duration) @index += 1 result else nil end end |