Sha256: ade84e8de5a531da7e7fa2e55e01293742cd66c9dc1d4a2484aad626dc955da6

Contents?: true

Size: 954 Bytes

Versions: 46

Compression:

Stored size: 954 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    module Calendar
      # This class handles how to convert an organization meetings to the
      # ICalendar format. It finds the public meeting components for that
      # organization and delegates the work to the `ComponentCalendar` class.
      class OrganizationCalendar < BaseCalendar
        # Renders the meetings in an ICalendar format. It caches the results in
        # Rails' cache.
        #
        # Returns a String.
        def events
          @events ||= components.map do |component|
            ComponentCalendar.new(component).events
          end.compact.join
        end

        private

        alias organization resource

        # Finds the component meetings.
        #
        # Returns a collection of Meetings.
        def components
          Decidim::PublicComponents.for(organization, manifest_name: :meetings)
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-meetings-0.26.10 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.9 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.8 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.7 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.5 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.4 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.3 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.2 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.1 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.0 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.0.rc2 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.26.0.rc1 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.2 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.1 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.0 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.0.rc4 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.0.rc3 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.0.rc2 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.25.0.rc1 app/services/decidim/meetings/calendar/organization_calendar.rb
decidim-meetings-0.24.3 app/services/decidim/meetings/calendar/organization_calendar.rb