Class: Tessa::ActiveStorage::AssetWrapper
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Tessa::ActiveStorage::AssetWrapper
- Defined in:
- lib/tessa/active_storage/asset_wrapper.rb
Instance Method Summary collapse
- #failure? ⇒ Boolean
- #id ⇒ Object
- #meta ⇒ Object
- #private_download_url(expires_in: 1.day) ⇒ Object
- #private_url(expires_in: 1.day) ⇒ Object
- #public_url ⇒ Object
Instance Method Details
#failure? ⇒ Boolean
27 28 29 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 27 def failure? false end |
#id ⇒ Object
3 4 5 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 3 def id key end |
#meta ⇒ Object
20 21 22 23 24 25 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 20 def { mime_type: content_type, size: byte_size } end |
#private_download_url(expires_in: 1.day) ⇒ Object
16 17 18 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 16 def private_download_url(expires_in: 1.day) service_url(disposition: 'attachment', expires_in: expires_in) end |
#private_url(expires_in: 1.day) ⇒ Object
12 13 14 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 12 def private_url(expires_in: 1.day) service_url(disposition: :inline, expires_in: expires_in) end |
#public_url ⇒ Object
7 8 9 10 |
# File 'lib/tessa/active_storage/asset_wrapper.rb', line 7 def public_url Rails.application.routes.url_helpers. rails_blob_url(__getobj__, disposition: :inline) end |