Class: Livecal::Parser
- Inherits:
-
Object
- Object
- Livecal::Parser
- Defined in:
- lib/livecal/parser.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(calendar_source, from:, to:) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(calendar_source, from:, to:) ⇒ Parser
Returns a new instance of Parser.
13 14 15 16 17 |
# File 'lib/livecal/parser.rb', line 13 def initialize(calendar_source, from:, to:) @calendar_source = calendar_source @from = from @to = to end |
Class Method Details
.call ⇒ Object
9 10 11 |
# File 'lib/livecal/parser.rb', line 9 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'lib/livecal/parser.rb', line 19 def call Calendar.new(events.collect { |event| Event.from_ical(event) }) end |