Class: Jekyll::Imgproxy::Tag::PathBuilder
- Inherits:
-
Object
- Object
- Jekyll::Imgproxy::Tag::PathBuilder
- Defined in:
- lib/jekyll/imgproxy/tag/path_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(config, options) ⇒ PathBuilder
constructor
A new instance of PathBuilder.
Constructor Details
#initialize(config, options) ⇒ PathBuilder
Returns a new instance of PathBuilder.
9 10 11 12 13 14 15 16 17 |
# File 'lib/jekyll/imgproxy/tag/path_builder.rb', line 9 def initialize(config, ) @config = config = @resizing_type = 'rs:fit' @width = ':' @height = ':' @format = '.jpg' end |
Instance Method Details
#build ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/jekyll/imgproxy/tag/path_builder.rb', line 19 def build .each { |key, value| send("#{key}=".to_sym, value) } raise Jekyll::Imgproxy::Tag::Errors::PathNotSet unless path "/#{resizing_type}#{width}#{height}#{gravity}#{quality}#{max_bytes}#{cache_buster}/#{encoded_url}#{format}" end |