class Decidim::Meetings::Calendar::ComponentCalendar

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

def cache_key

Returns a String.

Defines the cache key for the given component.
def cache_key
  "meetings-calendar-component-#{component.id}-#{component.updated_at.to_i}"
end

def events

Returns a String.

Rails' cache.
Renders the meetings in an ICalendar format. It caches the results in
def events
  Rails.cache.fetch(cache_key) do
    meetings.map do |meeting|
      MeetingToEvent.new(meeting).to_ical
    end.join
  end
end

def meetings

Returns a collection of Meetings.

Finds the component meetings.
def meetings
  Decidim::Meetings::Meeting.where(component: component)
end