Sha256: bd21aafbdcde873b9e38ef4e804c7b45e9145b3b24f4017555d544bf5c0f8abe

Contents?: true

Size: 230 Bytes

Versions: 11

Compression:

Stored size: 230 Bytes

Contents

class Numeric
  def self.from_xommelier(value)
    return nil if value.blank?
    begin
      value =~ /\./ ? Float(value) : Integer(value)
    rescue ArgumentError
      value
    end
  end

  def to_xommelier
    self
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xommelier-0.1.30 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.29 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.28 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.27 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.26 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.25 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.24 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.23 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.22 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.21 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.20 lib/xommelier/core_ext/numeric.rb