Sha256: e95d14094fbcde0996a7d9f4c697c1e1906a4e19ac5f40944c2ff03a58e0ae95

Contents?: true

Size: 940 Bytes

Versions: 2

Compression:

Stored size: 940 Bytes

Contents

module ActsAsFullCalendarEvent
  class FullCalendarEventSerializer < ActiveModel::Serializer
    attributes(
      :id,
      :start,
      :end,
      :title,
      :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 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

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_full_calendar_event-1.0.2 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb
acts_as_full_calendar_event-1.0.1 lib/acts_as_full_calendar_event/serializers/full_calendar_event_serializer.rb