Class: Decidim::Meetings::Calendar::ComponentCalendar

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

Overview

This class handles how to convert a component meetings to the ICalendar format. It caches its result until the component is updated again.

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 meetings in an ICalendar format. It caches the results in Rails' cache.

Returns a String.


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

def events
  Rails.cache.fetch(cache_key) do
    meetings.map do |meeting|
      MeetingCalendar.new(meeting).events
    end.compact.join
  end
end