Represents the data type Time without time zone.

Methods
Public Instance methods
equal( a, b )

Compares two values and returns true if equal or false otherwise. It is used to check if a row field has been changed so that only changed fields are written to database. Escapes before comparing.

# File lib/momomoto/datatype/time_without_time_zone.rb, line 14
      def equal( a, b )
        escape(a) == escape(b)
      end
escape( value )

Escapes value to be saved in database. Returns ‘NULL’ if value is nil.

# File lib/momomoto/datatype/time_without_time_zone.rb, line 20
      def escape( value )
        case value
          when nil then 'NULL'
          when String then "'#{Database.escape_string(value)}'"
          else "'#{Database.escape_string(value.strftime('%H:%M:%S'))}'"
        end
      end
filter_set( value )

Values are filtered by this function when being set. Returns an instance of Time or nil if value is nil or empty.

# File lib/momomoto/datatype/time_without_time_zone.rb, line 30
      def filter_set( value )
        case value
          when nil, '' then nil
          when ::Time then value
          when String then ::Time.parse( value )
          else raise Error
        end
       rescue => e
        raise ConversionError, 'Error while parsing time'
      end