Class: TimeLord::Scale

Inherits:
Object
  • Object
show all
Includes:
Units
Defined in:
lib/time-lord/scale.rb

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

Instance Method Summary collapse

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

#absoluteObject

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_unitObject



15
16
17
# File 'lib/time-lord/scale.rb', line 15

def to_unit
  timemap.last
end

#to_valueObject



11
12
13
# File 'lib/time-lord/scale.rb', line 11

def to_value
  timemap.first
end