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
-
#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
13 14 15 16 17 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 13 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.
10 11 12 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 10 def default_duration @default_duration end |
#occurrence_list ⇒ Object
Returns the value of attribute occurrence_list.
10 11 12 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 10 def occurrence_list @occurrence_list end |
Instance Method Details
#next_occurrence ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/ri_cal/property_value/occurrence_list.rb', line 19 def next_occurrence if @index < occurrence_list.length result = occurrence_list[@index].occurrence_hash(default_duration) @index += 1 result else nil end end |