enum RemiMath::Conv::Unit
Overview
A unit of measurement.
Defined in:
remilib/math/conversions.crEnum Members
-
Inches =
0
-
Distance
-
Feet =
1
-
Picometers =
2
-
Nanometers =
3
-
Micrometers =
4
-
Millimeters =
5
-
Centimeters =
6
-
Miles =
7
-
NauticalMiles =
8
-
Kilometers =
9
-
Parsecs =
10
-
Lightyears =
11
-
MilesPerHour =
12
-
Speed
-
KilometersPerHour =
13
-
Knots =
14
-
Kilograms =
15
-
Mass/Weight
-
Pounds =
16
-
Celsius =
17
-
Temperature
-
Fahrenheit =
18
-
Kelvin =
19
-
Rankine =
20
-
Degrees =
21
-
Angle/Circle stuff
-
Radians =
22
-
Liters =
23
-
Liquids
-
UsGallons =
24
-
UsPints =
25
Class Method Summary
-
.parseUnit?(name : String) : Unit | Nil
Similar to
Unit.parse?
, except that this also understands abbreviations and alternate spellings.
Instance Method Summary
-
#abbrev : String
Returns the abbreviation for this
Unit
. - #celsius?
- #centimeters?
-
#conv(other : Unit, value) : BigDecimal | Nil
Attempts to convert self to a new
Unit
value, returned as aBigDecimal
. - #degrees?
- #fahrenheit?
-
#fancyName : String
Returns the "fancy name" for this
Unit
. - #feet?
- #inches?
- #kelvin?
- #kilograms?
- #kilometers?
- #kilometers_per_hour?
- #knots?
- #lightyears?
- #liters?
- #micrometers?
- #miles?
- #miles_per_hour?
- #millimeters?
- #nanometers?
- #nautical_miles?
- #parsecs?
- #picometers?
- #pounds?
- #radians?
- #rankine?
- #us_gallons?
- #us_pints?
Class Method Detail
Similar to Unit.parse?
, except that this also understands abbreviations
and alternate spellings.
Instance Method Detail
Attempts to convert self to a new Unit
value, returned as a
BigDecimal
. If the conversion cannot happen, this returns nil
.
def fancyName : String
#
Returns the "fancy name" for this Unit
. This is a bit different than
#to_s
and Unit.names
in that it is downcase and may be an alternate
name (e.g. Unit::UsPints
= "pints"
).
The name returned here can be re-parsed using Unit.parseUnit?
.