Module: Imgproxy::OptionsCasters::Bool

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

Overview

Casts boolean option

Class Method Summary collapse

Class Method Details

.cast(raw) ⇒ Object



5
6
7
8
9
# File 'lib/imgproxy/options_casters/bool.rb', line 5

def self.cast(raw)
  return if raw.nil?

  raw && raw != 0 && raw != "0" ? 1 : 0
end