Class: Imgproxy::Builder
- Inherits:
-
Object
- Object
- Imgproxy::Builder
- Defined in:
- lib/imgproxy/builder.rb
Overview
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Builder
constructor
A new instance of Builder.
-
#url_for(image) ⇒ String
Genrates imgproxy URL.
Constructor Details
Instance Method Details
#url_for(image) ⇒ String
Genrates imgproxy URL
35 36 37 38 39 40 41 42 |
# File 'lib/imgproxy/builder.rb', line 35 def url_for(image) path = [*, "plain", url(image)].join("/") path = "#{path}@#{@options[:format]}" if @options[:format] signature = sign_path(path) URI.join(Imgproxy.config.endpoint.to_s, "#{signature}/#{path}").to_s end |