Sha256: 951700cf26c6f752aaefdec23638309945868b4f658ed224e7d0471531c0f6e3

Contents?: true

Size: 820 Bytes

Versions: 46

Compression:

Stored size: 820 Bytes

Contents

module ForestLiana
  class IntercomConversationSerializer
    include JSONAPI::Serializer

    attribute :created_at
    attribute :updated_at
    attribute :open
    attribute :read

    attribute :subject do
      object.conversation_message.subject
    end

    attribute :body do
      [object.conversation_message.body, object.link]
    end

    attribute :assignee do
      object.assignee.try(:email)
    end

    def self_link
      "/forest#{super}"
    end

    def type
      'intercom-conversations'
    end

    def format_name(attribute_name)
      attribute_name.to_s
    end

    def unformat_name(attribute_name)
      attribute_name.to_s.underscore
    end

    def relationship_self_link(attribute_name)
      nil
    end

    def relationship_related_link(attribute_name)
      nil
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
forest_liana-1.1.29 app/serializers/forest_liana/intercom_conversation_serializer.rb
forest_liana-1.1.28 app/serializers/forest_liana/intercom_conversation_serializer.rb
forest_liana-1.1.27 app/serializers/forest_liana/intercom_conversation_serializer.rb
forest_liana-1.1.26 app/serializers/forest_liana/intercom_conversation_serializer.rb
forest_liana-1.1.25 app/serializers/forest_liana/intercom_conversation_serializer.rb
forest_liana-1.1.23 app/serializers/forest_liana/intercom_conversation_serializer.rb