Sha256: 4afb9e385bfff823f70f1b5810ba2f297116684519b641b181f727ff03ef21e2

Contents?: true

Size: 264 Bytes

Versions: 10

Compression:

Stored size: 264 Bytes

Contents

class Numeric
  def to_bson(*args)
    self
  end
end

class BigDecimal
  def self.cast_from_string(string)
    BigDecimal.new(string) unless string.blank?
  end
end

class Integer
  def self.cast_from_string(string)
    string.to_i unless string.blank?
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mongo_doc-0.6.3 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.6.2 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.6.1 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.6.0 lib/mongo_doc/ext/numeric.rb
mongo_doc_rails2-0.6.1 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.5.5 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.4.2 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.4.1 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.4.0 lib/mongo_doc/ext/numeric.rb
mongo_doc-0.3.2 lib/mongo_doc/ext/numeric.rb