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



67
68
69
# File 'lib/locomotive/core_ext.rb', line 67

def self.get(value)
  value
end

.set(value) ⇒ Object



62
63
64
65
# File 'lib/locomotive/core_ext.rb', line 62

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