Class: SalesforceAdapter::Property::Boolean

Inherits:
DataMapper::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

#custom?Boolean

Returns:



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

def custom?
  true
end

#load(value) ⇒ Object



6
7
8
# File 'lib/dm-salesforce-adapter/property/boolean.rb', line 6

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

#typecast(value) ⇒ Object



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

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