Sha256: c3045e0ed6dd9a732c050933691581a1bec11bd5d7f6a236aa95db4707debb18

Contents?: true

Size: 314 Bytes

Versions: 7

Compression:

Stored size: 314 Bytes

Contents

class MLS::Attribute::Decimal < MLS::Attribute
  
  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

7 entries across 7 versions & 1 rubygems

Version Path
mls-0.14.0 lib/mls/attributes/decimal.rb
mls-0.13.0 lib/mls/attributes/decimal.rb
mls-0.12.5 lib/mls/attributes/decimal.rb
mls-0.12.4 lib/mls/attributes/decimal.rb
mls-0.12.2 lib/mls/attributes/decimal.rb
mls-0.12.3 lib/mls/attributes/decimal.rb
mls-0.12.1 lib/mls/attributes/decimal.rb