Class: DataMapper::Adapters::SalesforceAdapter::Property::Boolean

Inherits:
Property::Integer
  • Object
show all
Defined in:
lib/dm-salesforce-adapter/property/boolean.rb

Constant Summary collapse

FALSE =
0
TRUE =
1

Instance Method Summary collapse

Instance Method Details

#load(value) ⇒ Object



12
13
14
# File 'lib/dm-salesforce-adapter/property/boolean.rb', line 12

def load(value)
  [true, 1, '1', 'true', 'TRUE', TRUE].include?(value) ? true : false
end

#typecast(value) ⇒ Object



16
17
18
# File 'lib/dm-salesforce-adapter/property/boolean.rb', line 16

def typecast(value)
  [true, 1, '1', 'true', 'TRUE', TRUE].include?(value) ? TRUE : FALSE
end