Class: GoogleSearch
- Inherits:
-
Object
- Object
- GoogleSearch
- Defined in:
- lib/googlesearch.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(o = {}, search_request = SearchRequest.new) ⇒ GoogleSearch
constructor
A new instance of GoogleSearch.
Constructor Details
#initialize(o = {}, search_request = SearchRequest.new) ⇒ GoogleSearch
Returns a new instance of GoogleSearch.
14 15 16 |
# File 'lib/googlesearch.rb', line 14 def initialize(o = {}, search_request = SearchRequest.new) @response = SearchResponse.new( search_request.get("http://www.google.com/search?&q=#{o[:q]}&client=google-csbe&output=xml_no_dtd&cx=#{o[:cx]}&cr=lang_#{o[:cr]}&lr=lang_#{o[:lr]}&start=#{o[:start]}&num=#{o[:num]}"), o[:num], o[:start]) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
12 13 14 |
# File 'lib/googlesearch.rb', line 12 def response @response end |