Class: M9t::Speed

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/m9t/speed.rb

Overview

Represents a speed

Constant Summary collapse

DEFAULT_OPTIONS =
{
  units: :meters_per_second, abbreviated: false, precision: 5
}
SECONDS_PER_HOUR =
60.0 * 60
KMH =
M9t::Distance::CONVERSIONS[:kilometers] * SECONDS_PER_HOUR
MPH =
M9t::Distance::CONVERSIONS[:miles] * SECONDS_PER_HOUR
KNOTS =
KMH / 1.852
CONVERSIONS =
{
  meters_per_second:   1.0,
  kilometers_per_hour: KMH,
  miles_per_hour:      MPH,
  knots:               KNOTS
}

Instance Attribute Summary

Attributes included from Base

#options, #value

Method Summary

Methods included from Base

add_options, generate_conversions, included, #initialize, #method_missing, #respond_to?, #to_s

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class M9t::Base