Sha256: 6682cac4586849aecf3052e8ea718014512e57c4e258298e02dcd7f6dff4b661
Contents?: true
Size: 838 Bytes
Versions: 5
Compression:
Stored size: 838 Bytes
Contents
module Almanack module Representation class IcalFeed attr_reader :calendar def initialize(calendar) @calendar = calendar end def ical @ical ||= ical_calendar end def to_s ical.to_s end def self.from(calendar) self.new(calendar) end private def events calendar.events_between(now..lookahead) end def ical_calendar events.each_with_object(RiCal.Calendar) do |event, calendar_component| calendar_component.add_subcomponent ical_event_for(event) end end def ical_event_for(event) BuiltIcalEvent.for(event) end def lookahead now + calendar.feed_lookahead * ONE_DAY end def now @now ||= Time.now end end end end
Version data entries
5 entries across 5 versions & 1 rubygems