module OEmbed::Formatter::JSON::Backends::JSONGem

def decode(json)

Parses a JSON string or IO and convert it into an object.
def decode(json)
  if json.respond_to?(:read)
    json = json.read
  end
  ::JSON.parse(json)
end

def decode_fail_msg

def decode_fail_msg
  "The version of the json library you have installed isn't parsing JSON like ruby-oembed expected."
end

def parse_error

def parse_error
  ::JSON::ParserError
end