struct Clear::Interval
- Clear::Interval
- Struct
- Value
- Object
Overview
It can be converted automatically from/to a interval
column.
Usage example
class MyModel
include Clear::Model
column interval : Clear::TimeInDay
end
interval = Clear::Interval.new(60.days)
record = MyModel.create!(interval: interval)
Defined in:
clear/extensions/interval/interval.crConstructors
- .new(months : Int32 = 0, days : Int32 = 0, hours : Int32 = 0, minutes : Int32 = 0, seconds : Int32 = 0, milliseconds : Int32 = 0, microseconds : Int64 = 0)
-
.new(months : Int32, days : Int32, microseconds : Number)
For
PG::Interval
- .new(span : Time::Span)
- .new(span : Time::MonthSpan)
- .new(io : IO)
Class Method Summary
Instance Method Summary
- #+(interval : self)
- #days : Int32
- #hours : Int32
- #microseconds : Int64
- #milliseconds : Int32
- #minutes : Int32
- #months : Int32
- #seconds : Int32
- #to_json(json : JSON::Builder) : Nil
- #to_s(io)
- #to_sql
Constructor Detail
def self.new(months : Int32 = 0, days : Int32 = 0, hours : Int32 = 0, minutes : Int32 = 0, seconds : Int32 = 0, milliseconds : Int32 = 0, microseconds : Int64 = 0)
#