Module: DeviceMap::Properties::Types::Boolean

Defined in:
lib/device_map/properties/types.rb

Class Method Summary collapse

Class Method Details

.cast(value) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/device_map/properties/types.rb', line 11

def self.cast(value)
  case value
  when 'true' then true
  when 'false' then false
  else fail ArgumentError, "Cannot cast #{value} to boolean"
  end
end