class Numeric

© Alexander Semyonov, 2011—2013, MIT License # Author: Alexander Semyonov <al@semyonov.us> #

Public Class Methods

from_xommelier(value) click to toggle source
# File lib/xommelier/core_ext/numeric.rb, line 9
def self.from_xommelier(value)
  return nil if value.blank?
  begin
    value.match?(/\./) ? Float(value) : Integer(value)
  rescue ArgumentError
    value
  end
end

Public Instance Methods

to_xommelier() click to toggle source
# File lib/xommelier/core_ext/numeric.rb, line 18
def to_xommelier
  self
end