class PhusionPassenger::Utils::JSON
Usage:
JSON.parse(json_string) => Array/Hash JSON.generate(object) => json string
Run tests by executing this file directly. Pipe standard input to the script to have it parsed as JSON and to display the result in Ruby.
Constants
- AEN
- BOL
- CODE
- COL
- ESC
- HEN
- KEY
- NUL
- NUM
- OBJ
- SPEC
- STE
- STR
- UNI
- WSP
Attributes
scanner[R]
Public Class Methods
new(data)
click to toggle source
# File lib/phusion_passenger/utils/json.rb, line 57 def initialize data @scanner = StringScanner.new data.to_s end
parse(data)
click to toggle source
# File lib/phusion_passenger/utils/json.rb, line 42 def self.parse(data) new(data).parse end
Public Instance Methods
parse()
click to toggle source
# File lib/phusion_passenger/utils/json.rb, line 61 def parse space object end