class TimeSpanner::TimeUnits::Unit
Attributes
amount[RW]
duration[RW]
position[R]
rest[RW]
Public Class Methods
new(position)
click to toggle source
# File lib/time_spanner/time_units/base/unit.rb, line 10 def initialize position @position = position @amount = 0 @rest = 0 end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/time_spanner/time_units/base/unit.rb, line 20 def <=> other position <=> other.position end
plural_name()
click to toggle source
# File lib/time_spanner/time_units/base/unit.rb, line 24 def plural_name "#{self.class.name.split('::').last.downcase}s".to_sym end
reverse!()
click to toggle source
# File lib/time_spanner/time_units/base/unit.rb, line 16 def reverse! @amount = -amount end