Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/mext/numeric/meter.rb
Overview
we extend the String class to carry a to_meter which will convert a string into a meter
Instance Method Summary collapse
Instance Method Details
#to_meter ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/mext/numeric/meter.rb', line 59 def to_meter div = num = 1.0 (nums, divs) = self.split(/\s*\/\s*/, 2) num = nums.to_f div = divs.to_f Meter(num, div) end |