class TimeScales::Units::AbstractUnit

Public Instance Methods

===(other) click to toggle source
# File lib/time_scales/units.rb, line 10
def ===(other)
  self == other || symbol == other
end
name() click to toggle source
# File lib/time_scales/units.rb, line 25
def name
  @name ||= /::([^:]+)Class$/.match( self.class.name )[1]
end
scale() click to toggle source

Rough order of magnitude of subdivision unit size. 1.407 times the base-2 logarithm of approximate number of seconds per unit, then round to nearest integer.

# File lib/time_scales/units.rb, line 21
def scale
  raise NotImplementedError, "Subclass responsibility"
end
symbol() click to toggle source
# File lib/time_scales/units.rb, line 14
def symbol
  raise NotImplementedError, "Subclass responsibility"
end
to_time_scales_unit() click to toggle source
# File lib/time_scales/units.rb, line 6
def to_time_scales_unit
  self
end