module Encounter::ParserConvertors

@private Module holding conversions for parsed strings to numeric types

Public Class Methods

to_f(v) click to toggle source

@param v [String] @return [Float] Result of conversion

# File lib/encounter/parser.rb, line 137
def to_f(v)
  v.tr(',', '.').gsub(/[^0-9\.]/, '').to_f
end
to_i(v) click to toggle source

@param v [String] @return [Integer] Result of conversion

# File lib/encounter/parser.rb, line 143
def to_i(v)
  v.gsub(/\D/, '').to_i
end

Private Instance Methods

to_f(v) click to toggle source

@param v [String] @return [Float] Result of conversion

# File lib/encounter/parser.rb, line 137
def to_f(v)
  v.tr(',', '.').gsub(/[^0-9\.]/, '').to_f
end
to_i(v) click to toggle source

@param v [String] @return [Integer] Result of conversion

# File lib/encounter/parser.rb, line 143
def to_i(v)
  v.gsub(/\D/, '').to_i
end