Sha256: a5b8a30577781d218f53559c42224e65df468b61b3525c9956fb8e5ec050b37b

Contents?: true

Size: 583 Bytes

Versions: 28

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

class PageImageResource
  include Alba::Resource
  include Rails.application.routes.url_helpers
  include DynamicImage::Helper

  attributes :id, :image_id, :primary

  attribute :alternative do
    object.image.alternative
  end

  attribute :caption do
    object.image.caption
  end

  attribute :filename do
    object.image.filename
  end

  attribute :created_at do
    object.image.created_at
  end

  attribute :url do
    dynamic_image_path(
      object.image,
      size: "2000x2000",
      crop: false,
      upscale: false
    )
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pages_core-3.10.1 app/resources/page_image_resource.rb
pages_core-3.9.2 app/resources/page_image_resource.rb
pages_core-3.9.1 app/resources/page_image_resource.rb
pages_core-3.9.0 app/resources/page_image_resource.rb
pages_core-3.8.3 app/resources/page_image_resource.rb
pages_core-3.8.2 app/resources/page_image_resource.rb
pages_core-3.8.1 app/resources/page_image_resource.rb
pages_core-3.8.0 app/resources/page_image_resource.rb