class Runt::DPrecision::Precision
Simple value class for keeping track of precisioned dates
Constants
- DAY_PREC
- FIELD_MIN
Minimun values that precisioned fields get set to
- HOUR_PREC
- LABEL
String values for display
- MILLI_PREC
- MIN_PREC
- MONTH_PREC
- SEC_PREC
- WEEK_PREC
- YEAR_PREC
Some constants w/arbitrary integer values used internally for comparisions
Attributes
precision[R]
Public Class Methods
day()
click to toggle source
# File lib/runt/dprecision.rb, line 94 def Precision.day new(DAY_PREC) end
hour()
click to toggle source
# File lib/runt/dprecision.rb, line 98 def Precision.hour new(HOUR_PREC) end
millisec()
click to toggle source
# File lib/runt/dprecision.rb, line 110 def Precision.millisec new(MILLI_PREC) end
min()
click to toggle source
# File lib/runt/dprecision.rb, line 102 def Precision.min new(MIN_PREC) end
month()
click to toggle source
# File lib/runt/dprecision.rb, line 86 def Precision.month new(MONTH_PREC) end
new(prec)
click to toggle source
# File lib/runt/dprecision.rb, line 118 def initialize(prec) @precision = prec end
sec()
click to toggle source
# File lib/runt/dprecision.rb, line 106 def Precision.sec new(SEC_PREC) end
week()
click to toggle source
# File lib/runt/dprecision.rb, line 90 def Precision.week new(WEEK_PREC) end
year()
click to toggle source
# File lib/runt/dprecision.rb, line 82 def Precision.year new(YEAR_PREC) end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/runt/dprecision.rb, line 122 def <=>(other) self.precision <=> other.precision end
===(other)
click to toggle source
# File lib/runt/dprecision.rb, line 126 def ===(other) self.precision == other.precision end
label()
click to toggle source
# File lib/runt/dprecision.rb, line 134 def label LABEL[@precision] end
min_value()
click to toggle source
# File lib/runt/dprecision.rb, line 114 def min_value() FIELD_MIN[@precision] end
to_s()
click to toggle source
# File lib/runt/dprecision.rb, line 130 def to_s "DPrecision::#{self.label}" end