Density unit enumeration
Represents all supported density units. Each unit has:
- A conversion factor to grams per milliliter (the base unit)
- Methods to check unit system (metric/imperial)
- Symbol and name representations
- Aliases for common abbreviations
Usage
Unit::Density::Unit::GramPerMilliliter # Full enum reference
:gram_per_milliliter # Symbol shorthand in constructors
Unit::Density::Unit::GPerMl # Alias
Constants
GramPerCubicCentimeter = 2
KilogramPerCubicMeter = 3
GPerMl = 0
Common aliases for convenience
GPerMl2 = 0
Additional common abbreviations
Instance methods
g_per_cc?
Returns true if this enum value equals GPerCc
Sourceg_per_cm3?
Returns true if this enum value equals GPerCm3
Sourceg_per_ml2?
Returns true if this enum value equals GPerMl2
Sourceg_per_ml?
Returns true if this enum value equals GPerMl
Sourcegram_per_cubic_centimeter?
Returns true if this enum value equals GramPerCubicCentimeter
Sourcegram_per_milliliter?
Returns true if this enum value equals GramPerMilliliter
Sourceimperial?
Returns true if this unit is part of the imperial system
Sourcekg_per_l?
Returns true if this enum value equals KgPerL
Sourcekg_per_m3?
Returns true if this enum value equals KgPerM3
Sourcekilogram_per_cubic_meter?
Returns true if this enum value equals KilogramPerCubicMeter
Sourcekilogram_per_liter?
Returns true if this enum value equals KilogramPerLiter
Sourcelb_per_ft3?
Returns true if this enum value equals LbPerFt3
Sourcelb_per_gal?
Returns true if this enum value equals LbPerGal
Sourcemetric?
Returns true if this unit is part of the metric system
Sourcename(plural = false)
Returns the full name with proper pluralization
Sourceounce_per_cubic_inch?
Returns true if this enum value equals OuncePerCubicInch
Sourceoz_per_in3?
Returns true if this enum value equals OzPerIn3
Sourcepound_per_gallon?
Returns true if this enum value equals PoundPerGallon
Sourcesymbol
Returns the standard symbol for this unit
Source