Sha256: 1a80c82e3947c08aa81e3d8de1d7f2d219344d4fab33404e163155499633707f

Contents?: true

Size: 235 Bytes

Versions: 20

Compression:

Stored size: 235 Bytes

Contents

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

  def to_xommelier
    self
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
xommelier-0.1.19 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.18 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.16 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.15 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.14 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.13 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.12 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.11 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.10 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.9 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.8 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.7 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.6 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.5 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.4 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.3 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.2 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.1 lib/xommelier/core_ext/numeric.rb
xommelier-0.1.0 lib/xommelier/core_ext/numeric.rb
xommelier-0.0.2 lib/xommelier/core_ext/numeric.rb