Class: TimeLord::Scale
Constant Summary
Constants included from Units
Units::CENTURY, Units::DAY, Units::DECADE, Units::EON, Units::FORTNIGHT, Units::HOUR, Units::INDICTION, Units::JUBILEE, Units::LUSTRUM, Units::MILLENNIUM, Units::MINUTE, Units::MONTH, Units::OLYMPIAD, Units::QUARTER, Units::SECOND, Units::WEEK, Units::YEAR
Instance Attribute Summary collapse
-
#absolute ⇒ Object
Returns the value of attribute absolute.
Instance Method Summary collapse
-
#initialize(absolute) ⇒ Scale
constructor
A new instance of Scale.
- #to_unit ⇒ Object
- #to_value ⇒ Object
Constructor Details
#initialize(absolute) ⇒ Scale
Returns a new instance of Scale.
7 8 9 |
# File 'lib/time-lord/scale.rb', line 7 def initialize(absolute) self.absolute = absolute end |
Instance Attribute Details
#absolute ⇒ Object
Returns the value of attribute absolute.
5 6 7 |
# File 'lib/time-lord/scale.rb', line 5 def absolute @absolute end |
Instance Method Details
#to_unit ⇒ Object
15 16 17 |
# File 'lib/time-lord/scale.rb', line 15 def to_unit timemap.last end |
#to_value ⇒ Object
11 12 13 |
# File 'lib/time-lord/scale.rb', line 11 def to_value timemap.first end |