Module: Imgproxy::OptionsCasters::UnsharpMasking

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

Overview

Casts ‘unsharp_masking` info option

Constant Summary collapse

CASTER =
Imgproxy::OptionsCasters::Group.new(
  mode: Imgproxy::OptionsCasters::String,
  weight: Imgproxy::OptionsCasters::Float,
  divider: Imgproxy::OptionsCasters::Float,
).freeze

Class Method Summary collapse

Class Method Details

.cast(raw) ⇒ Object



17
18
19
20
21
22
# File 'lib/imgproxy/options_casters/unsharp_masking.rb', line 17

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

  values = CASTER.cast(raw)
  (values[0] == "none") ? "none" : values
end