Method: UnitMeasurements::Unit#inspect

Defined in:
lib/unit_measurements/unit.rb

#inspectObject

Returns an object representation of the unit, including its aliases if present.

Returns:

  • (Object)

    An object representation of the unit.

Author:

Since:

  • 1.0.0



131
132
133
134
# File 'lib/unit_measurements/unit.rb', line 131

def inspect
  aliases = "(#{@aliases.join(", ")})" if @aliases.any?
  "#<#{self.class.name}: #{name} #{aliases}>"
end