Sha256: 9fc78cf81f5dd5c1e95f8c6bcd432632deed72d9b01409ef157f90d1ae1c5cd0

Contents?: true

Size: 524 Bytes

Versions: 4

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    class MaterialSerializer < ActiveModel::Serializer
      self.root = false
      attributes :anchors, :id, :identifier, :gdoc_url, :orientation, :pdf_url, :source_type, :subtitle, :title,
                 :thumb_url, :pdf?
      delegate :anchors, :gdoc_url, :lesson, :orientation, :pdf_url, :source_type, :subtitle, :title,
               :thumb_url, to: :object

      def pdf?
        object.metadata['type'].casecmp('pdf').zero?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/serializers/lcms/engine/material_serializer.rb
lcms-engine-0.1.3 app/serializers/lcms/engine/material_serializer.rb
lcms-engine-0.1.2 app/serializers/lcms/engine/material_serializer.rb
lcms-engine-0.1.0 app/serializers/lcms/engine/material_serializer.rb