Class: Boolean

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

Overview

:nodoc

Constant Summary collapse

BOOLEAN_MAP =
{
  true => true, "true" => true, "TRUE" => true, "1" => true, 1 => true, 1.0 => true,
  false => false, "false" => false, "FALSE" => false, "0" => false, 0 => false, 0.0 => false
}

Class Method Summary collapse

Class Method Details

.get(value) ⇒ Object



60
61
62
# File 'lib/locomotive/core_ext.rb', line 60

def self.get(value)
  value
end

.set(value) ⇒ Object



55
56
57
58
# File 'lib/locomotive/core_ext.rb', line 55

def self.set(value)
  value = BOOLEAN_MAP[value]
  value.nil? ? nil : value
end