Class: Float
- Defined in:
- activesupport/lib/active_support/json/encoding.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
Encoding Infinity or NaN to JSON should return “null”.
Instance Method Details
#as_json(options = nil) ⇒ Object
Encoding Infinity or NaN to JSON should return “null”. The default returns “Infinity” or “NaN” which breaks parsing the JSON. E.g. JSON.parse(‘’).
227 228 229 |
# File 'activesupport/lib/active_support/json/encoding.rb', line 227 def as_json( = nil) #:nodoc: finite? ? self : nil end |