Class: Decidim::Meetings::Calendar::MeetingCalendar

Inherits:
BaseCalendar
  • Object
show all
Defined in:
decidim-meetings/app/services/decidim/meetings/calendar/meeting_calendar.rb

Overview

This class handles how to convert a single meeting to the ICalendar format. It caches its result until the meeting is updated again. This class generates a ICalendar entry for an individual meeting.

Instance Method Summary collapse

Methods inherited from BaseCalendar

#calendar, for, #initialize

Constructor Details

This class inherits a constructor from Decidim::Meetings::Calendar::BaseCalendar

Instance Method Details

#eventsObject

Renders the meeting in an ICalendar format. It caches the results in Rails' cache.

Returns a String.


14
15
16
17
18
# File 'decidim-meetings/app/services/decidim/meetings/calendar/meeting_calendar.rb', line 14

def events
  Rails.cache.fetch(cache_key) do
    MeetingToEvent.new(meeting).to_ical
  end
end