Sha256: d1b1e1ab76343b129ad6c9fb8f00ba39c62bdb401e980f51492fc938cbb99f82

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

module ActsAsFullCalendarEvent
  class FullCalendarEventSerializer < ActiveModel::Serializer
    attributes(
      :id,
      :start,
      :end,
      :title,
      :description,
      :color,
      :textColor,
      :link_url,
      :link_data_toggle,
      :link_data_target
    )

    def start
      object.calendar_item_start_at
    end

    def end
      object.calendar_item_end_at
    end

    def title
      object.calendar_item_title
    end

    def description
      object.calendar_item_description
    end

    def color
      if object.calendar_item_color.present?
        object.calendar_item_color
      else
        ""
      end
    end

    def textColor
      if object.calendar_item_text_color.present?
        object.calendar_item_text_color
      else
        ""
      end
    end

    def link_url
      object.calendar_item_url
    end

    def link_data_target
      object.calendar_item_link_data_target
    end

    def link_data_toggle
      object.calendar_item_link_data_toggle
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_full_calendar_event-1.0.6 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb
acts_as_full_calendar_event-1.0.5 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb
acts_as_full_calendar_event-1.0.4 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb
acts_as_full_calendar_event-1.0.3 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb