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.15.5 app/resources/page_image_resource.rb
pages_core-3.15.4 app/resources/page_image_resource.rb
pages_core-3.15.3 app/resources/page_image_resource.rb
pages_core-3.15.2 app/resources/page_image_resource.rb
pages_core-3.15.1 app/resources/page_image_resource.rb
pages_core-3.14.0 app/resources/page_image_resource.rb
pages_core-3.13.0 app/resources/page_image_resource.rb
pages_core-3.12.7 app/resources/page_image_resource.rb
pages_core-3.12.6 app/resources/page_image_resource.rb
pages_core-3.12.5 app/resources/page_image_resource.rb
pages_core-3.12.4 app/resources/page_image_resource.rb
pages_core-3.12.3 app/resources/page_image_resource.rb
pages_core-3.12.2 app/resources/page_image_resource.rb
pages_core-3.12.1 app/resources/page_image_resource.rb
pages_core-3.12.0 app/resources/page_image_resource.rb
pages_core-3.11.3 app/resources/page_image_resource.rb
pages_core-3.11.2 app/resources/page_image_resource.rb
pages_core-3.11.1 app/resources/page_image_resource.rb
pages_core-3.11.0 app/resources/page_image_resource.rb
pages_core-3.10.2 app/resources/page_image_resource.rb