Class: Cloudimage::URI
- Inherits:
-
Object
- Object
- Cloudimage::URI
- Includes:
- CustomHelpers, Params, Srcset
- Defined in:
- lib/cloudimage/uri.rb
Constant Summary
Constants included from Srcset
Srcset::SRCSET_GROWTH_FACTOR, Srcset::SRCSET_RANGE
Constants included from Params
Params::ALIASES, Params::PARAMS
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#sealed_params ⇒ Object
readonly
Returns the value of attribute sealed_params.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(path, **config) ⇒ URI
constructor
A new instance of URI.
- #to_url(**extra_params) ⇒ Object
Methods included from Srcset
Methods included from CustomHelpers
#positionable_crop, #seal_params
Constructor Details
#initialize(path, **config) ⇒ URI
Returns a new instance of URI.
21 22 23 24 25 26 27 |
# File 'lib/cloudimage/uri.rb', line 21 def initialize(path, **config) @config = config @params = {} @sealed_params = Set.new @path = transform(path) @uri = build_uri end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/cloudimage/uri.rb', line 19 def config @config end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
19 20 21 |
# File 'lib/cloudimage/uri.rb', line 19 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
19 20 21 |
# File 'lib/cloudimage/uri.rb', line 19 def path @path end |
#sealed_params ⇒ Object (readonly)
Returns the value of attribute sealed_params.
19 20 21 |
# File 'lib/cloudimage/uri.rb', line 19 def sealed_params @sealed_params end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
19 20 21 |
# File 'lib/cloudimage/uri.rb', line 19 def uri @uri end |
Instance Method Details
#to_url(**extra_params) ⇒ Object
41 42 43 44 45 |
# File 'lib/cloudimage/uri.rb', line 41 def to_url(**extra_params) set_uri_params(**extra_params) secure_url uri.to_s end |