Class: GoogleSearch
- Inherits:
-
Object
- Object
- GoogleSearch
- Defined in:
- lib/google_search/google_search.rb
Class Method Summary collapse
-
.default_options ⇒ Object
:singleton-method: Default options that should be present in every request.
-
.default_options=(options) ⇒ Object
:singleton-method: Sets up default options that should be present in every request.
-
.method_missing(method, args) ⇒ Object
:nodoc:.
-
.with_pages(pages) ⇒ Object
Yields the search method for number
pages
specified.
Class Method Details
.default_options ⇒ Object
:singleton-method: Default options that should be present in every request
26 27 28 |
# File 'lib/google_search/google_search.rb', line 26 def @default_options ||= {} end |
.default_options=(options) ⇒ Object
:singleton-method: Sets up default options that should be present in every request
33 34 35 |
# File 'lib/google_search/google_search.rb', line 33 def () @default_options = end |
.method_missing(method, args) ⇒ Object
:nodoc:
37 38 39 40 |
# File 'lib/google_search/google_search.rb', line 37 def method_missing(method, args) # :nodoc: raise "Unknown search type '#{method}'" unless supported_search_types.include?(method) query(method, args) end |
.with_pages(pages) ⇒ Object
Yields the search method for number pages
specified. Each page will contain 8 results, pages
must be something enumerable
44 45 46 47 48 49 50 51 |
# File 'lib/google_search/google_search.rb', line 44 def with_pages(pages) = .clone pages.each do |page| .merge!(:rsz => "large", :start => (page - 1) * 8) yield end = end |