Parent

Class/Module Index [+]

Quicksearch

Crack::JSON

Constants

DATE_REGEX

matches YAML-formatted dates

Public Class Methods

parse(json) click to toggle source
# File lib/crack/json.rb, line 11
def self.parse(json)
  YAML.load(unescape(convert_json_to_yaml(json)))
rescue ArgumentError => e
  raise ParseError, "Invalid JSON string"
end

Protected Class Methods

unescape(str) click to toggle source
# File lib/crack/json.rb, line 18
def self.unescape(str)
  str.gsub(/\\u([0-9a-f]{4})/) { [$1.hex].pack("U") }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.