Class DataMapper::Property::Boolean
In: lib/dm-core/property/boolean.rb
Parent: Object

Methods

Included Modules

PassThroughLoadDump

Constants

TRUE_VALUES = [ 1, '1', 't', 'T', 'true', 'TRUE' ].freeze
FALSE_VALUES = [ 0, '0', 'f', 'F', 'false', 'FALSE' ].freeze
BOOLEAN_MAP = Hash[ TRUE_VALUES.product([ true ]) + FALSE_VALUES.product([ false ]) ].freeze

Public Instance methods

Typecast a value to a true or false

@param [Integer, to_str] value

  value to typecast

@return [Boolean]

  true or false constructed from value

@api private

[Validate]