Class: IcalImporter::Builder
- Inherits:
-
Object
- Object
- IcalImporter::Builder
- Defined in:
- lib/ical_importer/builder.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#recurrence_builder ⇒ Object
readonly
Returns the value of attribute recurrence_builder.
Instance Method Summary collapse
- #build ⇒ Object
- #handle_as_recurrence? ⇒ Boolean
-
#initialize(event, recurrence_builder) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(event, recurrence_builder) ⇒ Builder
Returns a new instance of Builder.
4 5 6 7 |
# File 'lib/ical_importer/builder.rb', line 4 def initialize(event, recurrence_builder) @event = event @recurrence_builder = recurrence_builder end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
3 4 5 |
# File 'lib/ical_importer/builder.rb', line 3 def event @event end |
#recurrence_builder ⇒ Object (readonly)
Returns the value of attribute recurrence_builder.
3 4 5 |
# File 'lib/ical_importer/builder.rb', line 3 def recurrence_builder @recurrence_builder end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/ical_importer/builder.rb', line 13 def build if handle_as_recurrence? recurrence_builder << event nil # Don't want this messing up our collect in Collector else SingleEventBuilder.new(event).build end end |
#handle_as_recurrence? ⇒ Boolean
9 10 11 |
# File 'lib/ical_importer/builder.rb', line 9 def handle_as_recurrence? event.recurrence_id.present? end |