class AWS::Record::Attributes::BooleanAttr

Public Class Methods

allow_set?() click to toggle source

@private

# File lib/aws/record/attributes.rb, line 175
def self.allow_set?
  false
end
serialize(boolean, options = {}) click to toggle source
# File lib/aws/record/attributes.rb, line 164
def self.serialize boolean, options = {}
  case boolean
  when false then 0
  when true  then 1
  else 
    msg = "expected a boolean value, got #{boolean.class}"
    raise ArgumentError, msg
  end
end
type_cast(raw_value, options = {}) click to toggle source
# File lib/aws/record/attributes.rb, line 155
def self.type_cast raw_value, options = {}
  case raw_value
  when nil then nil
  when '' then nil
  when false, 'false', '0', 0 then false
  else true
  end
end