Class: ImproveTypography::Processors::Units
- Inherits:
-
ImproveTypography::Processor
- Object
- Struct
- ImproveTypography::Processor
- ImproveTypography::Processors::Units
- Defined in:
- lib/improve_typography/processors/units.rb
Constant Summary collapse
- REGEXP =
/(\d\s*)(m|mm|cm|km)(2|3)/
Instance Attribute Summary
Attributes inherited from ImproveTypography::Processor
Instance Method Summary collapse
Methods inherited from ImproveTypography::Processor
Constructor Details
This class inherits a constructor from ImproveTypography::Processor
Instance Method Details
#call ⇒ Object
6 7 8 9 |
# File 'lib/improve_typography/processors/units.rb', line 6 def call return str unless str.match?(REGEXP) str.gsub(REGEXP, '\1\2<sup>\3</sup>') end |