Class Sequel::SQLTime
In: lib/sequel/sql.rb
Parent: ::Time

Time subclass that gets literalized with only the time value, so it operates like a standard SQL time type.

Methods

create   date   to_s  

Attributes

date  [W]  Set the date used for SQLTime instances.

Public Class methods

Create a new SQLTime instance given an hour, minute, and second.

[Source]

    # File lib/sequel/sql.rb, line 59
59:       def create(hour, minute, second, usec = 0)
60:         t = date
61:         local(t.year, t.month, t.day, hour, minute, second, usec)
62:       end

[Source]

    # File lib/sequel/sql.rb, line 54
54:       def date
55:         @date || now
56:       end

Public Instance methods

Return a string in HH:MM:SS format representing the time.

[Source]

    # File lib/sequel/sql.rb, line 66
66:     def to_s(*args)
67:       if args.empty?
68:         strftime('%H:%M:%S')
69:       else
70:         # Superclass may have defined a method that takes a format string,
71:         # and we shouldn't override in that case.
72:         super
73:       end
74:     end

[Validate]