class String

Convert string to float or integer if applicable.

Public Instance Methods

to_num() click to toggle source
# File lib/BioDSL.rb, line 39
def to_num
  Integer(self)
  to_i
rescue ArgumentError
  begin
    Float(self)
    to_f
  rescue ArgumentError
    self
  end
end