Method: UnitMeasurements::Unit#to_s

Defined in:
lib/unit_measurements/unit.rb

#to_sString

Returns the name of the unit as a string.

Examples:

UnitMeasurements::Length.new(1, "m").unit.to_s
=> "m"

Returns:

  • (String)

    The name of the unit.

Author:

Since:

  • 1.0.0



121
122
123
# File 'lib/unit_measurements/unit.rb', line 121

def to_s
  name
end