method
as_json
v4.0.2 -
Show latest stable
- Class:
Float
as_json(options = nil)public
Encoding Infinity or NaN to JSON should return “null”. The default returns “Infinity” or “NaN” which breaks parsing the JSON. E.g. JSON.parse(‘[NaN]’).