Class: DataMapper::Salesforce::Types::Boolean

Inherits:
DataMapper::Salesforce::Type show all
Defined in:
lib/dm-salesforce/types/boolean.rb

Constant Summary collapse

FALSE =
0
TRUE =
1

Class Method Summary collapse

Class Method Details

.dump(value, property) ⇒ Object



9
10
11
12
13
14
# File 'lib/dm-salesforce/types/boolean.rb', line 9

def self.dump(value, property)
  case value
  when nil, false then FALSE
  else TRUE
  end
end

.load(value, property) ⇒ Object



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

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