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>'
- SCALAR_FORMAT =
'~%0.4f'
- UNIT_FORMAT =
' %s/%s'
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
28 29 30 31 32 |
# File 'lib/auom/inspection.rb', line 28 def self.prettify_unit_part(base) counts(base).map do |unit, length| length > 1 ? "#{unit}^#{length}" : unit end.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
16 17 18 |
# File 'lib/auom/inspection.rb', line 16 def inspect format(INSPECT_FORMAT, self.class, pretty_scalar, pretty_unit) end |