Class: Boolean

Inherits:
Object
  • Object
show all
Defined in:
lib/xommelier/core_ext/boolean.rb

Constant Summary collapse

BOOLEAN_MAP =

noinspection RubyStringKeysInHashInspection,RubyDuplicatedKeysInHashInspection

{
  true => true, 'true' => true, 'TRUE' => true, '1' => true, '1.0' => true, 1 => true, 1.0 => true,
  false => false, 'false' => false, 'FALSE' => false, '0' => false, '0.0' => false, 0 => false, 0.0 => false, nil => false, '' => false
}.freeze

Class Method Summary collapse

Class Method Details

.from_xommelier(value) ⇒ Object



18
19
20
# File 'lib/xommelier/core_ext/boolean.rb', line 18

def self.from_xommelier(value)
  BOOLEAN_MAP[value]
end