Class: Imgproxy::UrlBuilders::Base
- Inherits:
-
Object
- Object
- Imgproxy::UrlBuilders::Base
- Defined in:
- lib/imgproxy/url_builders/base.rb
Overview
Builds imgproxy URL
builder = Imgproxy::UrlBuilders::Base.new(
width: 500,
height: 400,
resizing_type: :fill,
sharpen: 0.5
)
builder.url_for("http://images.example.com/images/image1.jpg")
builder.url_for("http://images.example.com/images/image2.jpg")
Direct Known Subclasses
Constant Summary collapse
- OPTIONS_BUILDER =
OptionsBuilders::Base
- OPTION_ALIASES =
{}.freeze
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#url_for(_image) ⇒ String
Genrates imgproxy URL.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
33 34 35 36 37 38 39 |
# File 'lib/imgproxy/url_builders/base.rb', line 33 def initialize( = {}) = .dup () @options = self.class::OPTIONS_BUILDER.new() end |
Instance Method Details
#url_for(_image) ⇒ String
Genrates imgproxy URL
48 49 50 |
# File 'lib/imgproxy/url_builders/base.rb', line 48 def url_for(_image) raise NotImplementedError end |