Class: Ohm::Types::Boolean

Inherits:
Object
  • Object
show all
Defined in:
lib/ohm/contrib/typecast.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) [](value)



128
129
130
131
132
133
# File 'lib/ohm/contrib/typecast.rb', line 128

def self.[](value)
  case value
  when 'false', false, '0', 0 then false
  when 'true',  true,  '1', 1  then true
  end
end