Sha256: 4355b3bccfed9f1be2df582c654abcaec2fdd07573cc0c2c99a556ea4c80542f

Contents?: true

Size: 473 Bytes

Versions: 37

Compression:

Stored size: 473 Bytes

Contents

require 'active_support/deprecation'

ActiveSupport::Deprecation.warn 'core_ext/big_decimal/yaml_conversions is deprecated and will be removed in the future.'

require 'bigdecimal'
require 'yaml'
require 'active_support/core_ext/big_decimal/conversions'

class BigDecimal
  YAML_MAPPING = { 'Infinity' => '.Inf', '-Infinity' => '-.Inf', 'NaN' => '.NaN' }

  def encode_with(coder)
    string = to_s
    coder.represent_scalar(nil, YAML_MAPPING[string] || string)
  end
end

Version data entries

37 entries across 36 versions & 8 rubygems

Version Path
activesupport-4.2.11.3 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.11.2 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.11.1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.11 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.10 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.10.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.9 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.9.rc2 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.9.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activesupport-4.2.8/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.8 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.8.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.7.1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.7 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.7.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.6 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.6.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb