Module: Imgproxy::OptionsCasters::Resize

Defined in:
lib/imgproxy/options_casters/resize.rb

Overview

Casts ‘resize` processing option

Class Method Summary collapse

Class Method Details

.cast(raw) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/imgproxy/options_casters/resize.rb', line 13

def self.cast(raw)
  return raw unless raw.is_a?(Hash)

  [
    Imgproxy::OptionsCasters::String.cast(raw[:resizing_type]) || "fit",
    *Imgproxy::OptionsCasters::Size.cast(raw),
  ].trim!
end