Class JSON::Parser
In: lib/facets/more/json.rb
Parent: StringScanner

This class implements the JSON parser that is used to parse a JSON string into a Ruby data structure.

Methods

parse  

Constants

STRING = /"((?:[^"\\]|\\.)*)"/
INTEGER = /-?\d+/
FLOAT = /-?\d+\.(\d*)(?i:e[+-]?\d+)?/
OBJECT_OPEN = /\{/
OBJECT_CLOSE = /\}/
ARRAY_OPEN = /\[/
ARRAY_CLOSE = /\]/
PAIR_DELIMITER = /:/
COLLECTION_DELIMITER = /,/
TRUE = /true/
FALSE = /false/
NULL = /null/
IGNORE = %r( (?: //[^\n\r]*[\n\r]| # line comments /\* # c-style comments (?: [^*/]| # normal chars /[^*]| # slashes that do not start a nested comment \*[^/]| # asterisks that do not end this comment /(?=\*/) # single slash before this comment's end )* \*/ # the end of this comment |\s+ # whitespaces )+ )mx
UNPARSED = Object.new

Public Instance methods

Parses the current JSON string and returns the complete data structure as a result.

[Validate]