Class: Almanack::EventSource::Ical

Inherits:
Object
  • Object
show all
Defined in:
lib/almanack/event_source/ical.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Ical

Returns a new instance of Ical.



6
7
8
# File 'lib/almanack/event_source/ical.rb', line 6

def initialize(io)
  @io = io
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



4
5
6
# File 'lib/almanack/event_source/ical.rb', line 4

def io
  @io
end

Class Method Details

.from(*args) ⇒ Object



18
19
20
# File 'lib/almanack/event_source/ical.rb', line 18

def self.from(*args)
  self.new(*args)
end

Instance Method Details

#events_between(date_range) ⇒ Object



10
11
12
# File 'lib/almanack/event_source/ical.rb', line 10

def events_between(date_range)
  occurrences_between(date_range).map(&method(:event_from))
end

#serialized_between(date_range) ⇒ Object



14
15
16
# File 'lib/almanack/event_source/ical.rb', line 14

def serialized_between(date_range)
  { events: events_between(date_range).map(&:serialized) }
end