Class: Uploadcare::Rails::Transformations::ImageTransformations
- Inherits:
-
Object
- Object
- Uploadcare::Rails::Transformations::ImageTransformations
- Defined in:
- lib/uploadcare/rails/transformations/image_transformations.rb
Overview
A class for building image urls after image transformations.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ ImageTransformations
constructor
A new instance of ImageTransformations.
Constructor Details
#initialize(options = {}) ⇒ ImageTransformations
Returns a new instance of ImageTransformations.
10 11 12 13 14 |
# File 'lib/uploadcare/rails/transformations/image_transformations.rb', line 10 def initialize( = {}) raise ArgumentError, "Options argument must be a Hash, #{.class} is given?" unless .is_a?(Hash) @options = .to_h { |k, v| [k.to_sym, v] } end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'lib/uploadcare/rails/transformations/image_transformations.rb', line 16 def call .compact.join('-').squeeze('/').gsub(/\s/, '').presence end |