Module: Imgproxy::OptionsCasters::PngOptions

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

Overview

Casts png_options option

Constant Summary collapse

CASTER =
Imgproxy::OptionsCasters::Group.new(
  interlaced: Imgproxy::OptionsCasters::Bool,
  quantize: Imgproxy::OptionsCasters::Bool,
  quantization_colors: Imgproxy::OptionsCasters::Integer,
).freeze

Class Method Summary collapse

Class Method Details

.cast(raw) ⇒ Object



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

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

  values = CASTER.cast(raw)
  values.empty? ? nil : values
end