Class: Imgproxy::UrlAdapters::Shrine
- Inherits:
-
Object
- Object
- Imgproxy::UrlAdapters::Shrine
- Defined in:
- lib/imgproxy/url_adapters/shrine.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
- #applicable?(image) ⇒ Boolean
-
#initialize(host: nil) ⇒ Shrine
constructor
A new instance of Shrine.
- #url(image) ⇒ Object
Constructor Details
#initialize(host: nil) ⇒ Shrine
Returns a new instance of Shrine.
11 12 13 |
# File 'lib/imgproxy/url_adapters/shrine.rb', line 11 def initialize(host: nil) @host = host end |
Instance Method Details
#applicable?(image) ⇒ Boolean
15 16 17 |
# File 'lib/imgproxy/url_adapters/shrine.rb', line 15 def applicable?(image) image.is_a?(::Shrine::UploadedFile) end |
#url(image) ⇒ Object
19 20 21 22 23 |
# File 'lib/imgproxy/url_adapters/shrine.rb', line 19 def url(image) opts = {} opts[:host] = @host if @host image.url(opts) end |