Class: GoogleAjax::Search
- Inherits:
-
Object
- Object
- GoogleAjax::Search
show all
- Defined in:
- lib/google_ajax/search.rb
Defined Under Namespace
Classes: Cursor, Page, Result, Results
Constant Summary
collapse
- SEARCH_VERSION =
1.0
Class Method Summary
collapse
-
.blogs(query, args = {}) ⇒ Object
-
.books(query, args = {}) ⇒ Object
-
.get(method, query, args = {}) ⇒ Object
-
.images(query, args = {}) ⇒ Object
-
.local(query, latitude, longitude, args = {}) ⇒ Object
-
.news(query, args = {}) ⇒ Object
-
.video(query, args = {}) ⇒ Object
-
.web(query, args = {}) ⇒ Object
Class Method Details
.blogs(query, args = {}) ⇒ Object
9
10
11
|
# File 'lib/google_ajax/search.rb', line 9
def self.blogs(query, args = {})
self.get(:blogs, query, args)
end
|
.books(query, args = {}) ⇒ Object
13
14
15
|
# File 'lib/google_ajax/search.rb', line 13
def self.books(query, args = {})
self.get(:books, query, args)
end
|
.get(method, query, args = {}) ⇒ Object
4
5
6
7
|
# File 'lib/google_ajax/search.rb', line 4
def self.get(method, query, args = {})
args = { :v => SEARCH_VERSION }.merge!(args)
GoogleAjax::get(:search, method, query, args)
end
|
.images(query, args = {}) ⇒ Object
17
18
19
|
# File 'lib/google_ajax/search.rb', line 17
def self.images(query, args = {})
self.get(:images, query, args)
end
|
.local(query, latitude, longitude, args = {}) ⇒ Object
21
22
23
24
|
# File 'lib/google_ajax/search.rb', line 21
def self.local(query, latitude, longitude, args = {})
args = { :sll => "#{latitude},#{longitude}" }.merge!(args)
self.get(:local, query, args)
end
|
.news(query, args = {}) ⇒ Object
26
27
28
|
# File 'lib/google_ajax/search.rb', line 26
def self.news(query, args = {})
self.get(:news, query, args)
end
|
.video(query, args = {}) ⇒ Object
30
31
32
|
# File 'lib/google_ajax/search.rb', line 30
def self.video(query, args = {})
self.get(:video, query, args)
end
|
.web(query, args = {}) ⇒ Object
34
35
36
|
# File 'lib/google_ajax/search.rb', line 34
def self.web(query, args = {})
self.get(:web, query, args)
end
|