Class: GnipApi::JsonParser
- Inherits:
-
Object
- Object
- GnipApi::JsonParser
- Defined in:
- lib/gnip_api/json_parser.rb
Instance Method Summary collapse
Instance Method Details
#encode(data) ⇒ Object
11 12 13 |
# File 'lib/gnip_api/json_parser.rb', line 11 def encode data return encoder.encode(data) end |
#parse(data) ⇒ Object
3 4 5 6 7 8 9 |
# 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.}") end end |