This class represents values of boolean type.

Public Instance methods
escape( input )

Converts the given input to true or false if possible. Otherwise returns NULL.

# File lib/momomoto/datatype/boolean.rb, line 22
      def escape( input )
        case input
          when true, 1, 't', 'true', 'on' then "'t'"
          when false, 0, 'f', 'false', 'off' then "'f'"
          else "NULL"
filter_set( value )

Values are filtered by this method when being set. Returns true or false. If the given value cannot be converted to true or false and NULL is not allowed, than again return false. Otherwise return nil.

# File lib/momomoto/datatype/boolean.rb, line 12
      def filter_set( value )
        case value
          when true, 1, 't', 'true', 'on' then true
          when false, 0, 'f', 'false', 'off' then false
          else not_null? ? false : nil