Class: Float
- Defined in:
- lib/active_support/core_ext/object/json.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
Encoding Infinity or NaN to JSON should return “null”.
Methods included from ActiveSupport::NumericWithFormat
Methods included from ActiveSupport::DeprecatedNumericWithFormat
Instance Method Details
#as_json(options = nil) ⇒ Object
Encoding Infinity or NaN to JSON should return “null”. The default returns “Infinity” or “NaN” which are not valid JSON.
113 114 115 |
# File 'lib/active_support/core_ext/object/json.rb', line 113 def as_json( = nil) # :nodoc: finite? ? self : nil end |