Module: AUOM::Inspection
- Included in:
- Unit
- Defined in:
- lib/auom/inspection.rb
Overview
Inspection module for auom units
Constant Summary collapse
- INSPECT_FORMAT =
'<%s @scalar=%s%s>'.freeze
- SCALAR_FORMAT =
'~%0.4f'.freeze
- UNIT_FORMAT =
' %s/%s'.freeze
Class Method Summary collapse
-
.prettify_unit_part(base) ⇒ String
private
Return prettified units.
Instance Method Summary collapse
-
#inspect ⇒ String
private
Return inspectable representation.
Class Method Details
.prettify_unit_part(base) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return prettified units
27 28 29 |
# File 'lib/auom/inspection.rb', line 27 def self.prettify_unit_part(base) counts(base).map { |unit, length| length > 1 ? "#{unit}^#{length}" : unit }.join('*') end |
Instance Method Details
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return inspectable representation
15 16 17 |
# File 'lib/auom/inspection.rb', line 15 def inspect format(INSPECT_FORMAT, self.class, pretty_scalar, pretty_unit) end |