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.2.44 lib/mls/properties/decimal.rb
mls-0.2.43 lib/mls/properties/decimal.rb
mls-0.2.42 lib/mls/properties/decimal.rb
mls-0.2.41 lib/mls/properties/decimal.rb
mls-0.2.40 lib/mls/properties/decimal.rb
mls-0.2.39 lib/mls/properties/decimal.rb
mls-0.2.38 lib/mls/properties/decimal.rb
mls-0.2.37 lib/mls/properties/decimal.rb
mls-0.2.36 lib/mls/properties/decimal.rb
mls-0.2.35 lib/mls/properties/decimal.rb
mls-0.2.34 lib/mls/properties/decimal.rb
mls-0.2.33 lib/mls/properties/decimal.rb
mls-0.2.32 lib/mls/properties/decimal.rb
mls-0.2.31 lib/mls/properties/decimal.rb
mls-0.2.29 lib/mls/properties/decimal.rb
mls-0.2.28 lib/mls/properties/decimal.rb
mls-0.2.26 lib/mls/properties/decimal.rb
mls-0.2.25 lib/mls/properties/decimal.rb
mls-0.2.24 lib/mls/properties/decimal.rb
mls-0.2.23 lib/mls/properties/decimal.rb