Sha256: 3cea835fba6f158f7654031a27ad04680d66dbe451ddfe880b68242ac9668f6b

Contents?: true

Size: 435 Bytes

Versions: 63

Compression:

Stored size: 435 Bytes

Contents

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

63 entries across 62 versions & 7 rubygems

Version Path
activesupport-4.1.16 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.16.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.15 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.15.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.14.2 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activejob-lock-0.0.2 rails/activesupport/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.14.1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.14 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.14.rc2 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.14.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.13 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.13.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activesupport-4.2.2/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activesupport-4.2.1/lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.12 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.1.12.rc1 lib/active_support/core_ext/big_decimal/yaml_conversions.rb
activesupport-4.2.2 lib/active_support/core_ext/big_decimal/yaml_conversions.rb