class GnipApi::JsonParser

  1. lib/gnip_api/json_parser.rb
Superclass: Object

Methods

Public Instance

  1. encode
  2. parse

Public Instance methods

encode (data)
[show source]
# File lib/gnip_api/json_parser.rb, line 11
def encode data
  return encoder.encode(data)
end
parse (data)
[show source]
# File lib/gnip_api/json_parser.rb, line 3
def parse data
  begin
    return parser.parse(data)
  rescue Yajl::ParseError => error
    raise GnipApi::Errors::JsonParser::ParseError.new("Yajl failed to parse: #{error.class} -- #{error.message}")
  end
end