Sha256: 0fab373e4bf3880d3d8374fa1c7ad0a086d1f075845522061fa52f0109550e66

Contents?: true

Size: 312 Bytes

Versions: 102

Compression:

Stored size: 312 Bytes

Contents

class MLS::Property::Decimal < MLS::Property
  
  def load(value) # from_json
    if value.nil?
			nil
		elsif value.is_a?(BigDecimal)
      value
    else
      BigDecimal.new(value.to_s)
    end
  end
  
  def dump(value)
    if value.is_a?(BigDecimal)
      value.to_s
    else
      value
    end
  end

end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
mls-0.4.0 lib/mls/properties/decimal.rb
mls-0.3.8 lib/mls/properties/decimal.rb
mls-0.3.7 lib/mls/properties/decimal.rb
mls-0.3.6 lib/mls/properties/decimal.rb
mls-0.3.5 lib/mls/properties/decimal.rb
mls-0.3.4 lib/mls/properties/decimal.rb
mls-0.3.3 lib/mls/properties/decimal.rb
mls-0.3.2 lib/mls/properties/decimal.rb
mls-0.3.1 lib/mls/properties/decimal.rb
mls-0.3.0 lib/mls/properties/decimal.rb
mls-0.2.54 lib/mls/properties/decimal.rb
mls-0.2.53 lib/mls/properties/decimal.rb
mls-0.2.52 lib/mls/properties/decimal.rb
mls-0.2.51 lib/mls/properties/decimal.rb
mls-0.2.50 lib/mls/properties/decimal.rb
mls-0.2.49 lib/mls/properties/decimal.rb
mls-0.2.48 lib/mls/properties/decimal.rb
mls-0.2.47 lib/mls/properties/decimal.rb
mls-0.2.46 lib/mls/properties/decimal.rb
mls-0.2.45 lib/mls/properties/decimal.rb