Sha256: 68a0a226ac06cc40401fad99ac0661acddadfb57c5d10f35547696413c617a4a

Contents?: true

Size: 511 Bytes

Versions: 4

Compression:

Stored size: 511 Bytes

Contents

module Tessa::ActiveStorage
  class AssetWrapper < SimpleDelegator
    def public_url
      Rails.application.routes.url_helpers.
        rails_blob_url(__getobj__, disposition: :inline)
    end

    def private_url(expires_in: 1.day)
      service_url(disposition: :inline, expires_in: expires_in)
    end

    def private_download_url(expires_in: 1.day)
      service_url(disposition: 'attachment', expires_in: expires_in)
    end

    def meta
      {}
    end

    def failure?
      false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tessa-1.0.0 lib/tessa/active_storage/asset_wrapper.rb
tessa-1.0.0.pre.rc3 lib/tessa/active_storage/asset_wrapper.rb
tessa-1.0.0.pre.rc2 lib/tessa/active_storage/asset_wrapper.rb
tessa-1.0.0.pre.rc1 lib/tessa/active_storage/asset_wrapper.rb