Class: GoogleAjax::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/google_ajax/parser.rb,
lib/google_ajax/parser.rb

Constant Summary collapse

PARSERS =
{
  :feed     => { :find => FeedFind, :load => FeedLoad, :lookup => FeedLookup },
  :language => { :detect => LanguageDetect, :translate => LanguageTranslate, },
  :search   => { :blogs => SearchBlogs, :books => SearchBooks, :images => SearchImages, :local => SearchLocal, :news => SearchNews, :video => SearchVideo, :web => SearchWeb }
}

Class Method Summary collapse

Class Method Details

.parse(api, method, data) ⇒ Object



3
4
5
6
7
8
# File 'lib/google_ajax/parser.rb', line 3

def self.parse(api, method, data)
  data = JSON.parse(data)
  Errors.process(data)
  parser = Parser::PARSERS[api][method]
  parser.process(data['responseData'])
end