123456789_123456789_123456789_123456789_123456789_

Class: BigDecimal

Constant Summary

Instance Method Summary

Instance Method Details

#_original_to_s

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/big_decimal/conversions.rb', line 14

alias_method :_original_to_s, :to_s

#encode_with(coder)

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/big_decimal/yaml_conversions.rb', line 12

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

#to_formatted_s(*args) Also known as: #to_s

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/big_decimal/conversions.rb', line 6

def to_formatted_s(*args)
  if args[0].is_a?(Symbol)
    super
  else
    format = args[0] || DEFAULT_STRING_FORMAT
    _original_to_s(format)
  end
end

#to_s(*args)

Alias for #to_formatted_s.

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/big_decimal/conversions.rb', line 15

alias_method :to_s, :to_formatted_s