Class: Imgproxy::UrlAdapters::ActiveStorageGCS
- Inherits:
-
ActiveStorage
- Object
- ActiveStorage
- Imgproxy::UrlAdapters::ActiveStorageGCS
- Defined in:
- lib/imgproxy/url_adapters/active_storage_gcs.rb
Overview
Instance Attribute Summary collapse
-
#bucket_name ⇒ String
readonly
Google Cloud Storage bucket name.
Instance Method Summary collapse
- #applicable?(image) ⇒ Boolean
-
#initialize(bucket_name) ⇒ ActiveStorageGCS
constructor
A new instance of ActiveStorageGCS.
- #url(image) ⇒ Object
Constructor Details
#initialize(bucket_name) ⇒ ActiveStorageGCS
Returns a new instance of ActiveStorageGCS.
14 15 16 |
# File 'lib/imgproxy/url_adapters/active_storage_gcs.rb', line 14 def initialize(bucket_name) @bucket_name = bucket_name end |
Instance Attribute Details
#bucket_name ⇒ String (readonly)
Returns Google Cloud Storage bucket name.
19 20 21 |
# File 'lib/imgproxy/url_adapters/active_storage_gcs.rb', line 19 def bucket_name @bucket_name end |
Instance Method Details
#applicable?(image) ⇒ Boolean
21 22 23 24 |
# File 'lib/imgproxy/url_adapters/active_storage_gcs.rb', line 21 def applicable?(image) super && image.service.is_a?(::ActiveStorage::Service::GCSService) end |
#url(image) ⇒ Object
26 27 28 |
# File 'lib/imgproxy/url_adapters/active_storage_gcs.rb', line 26 def url(image) "gs://#{bucket_name}/#{image.key}" end |