Class: Yahoo::SE::Pages
- Inherits:
-
Object
- Object
- Yahoo::SE::Pages
- Includes:
- Paginator
- Defined in:
- lib/yahoo-se/pages.rb
Constant Summary collapse
- SERVICE_PATH =
"#{Yahoo::SE::SERVICE_PATH}/pageData"
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(domain, options = {}) ⇒ Pages
constructor
A new instance of Pages.
-
#results ⇒ Object
Displays the results for pages data.
Methods included from Paginator
#last?, #method_missing, #next, #response, #total_results_available
Constructor Details
#initialize(domain, options = {}) ⇒ Pages
Returns a new instance of Pages.
21 22 23 24 25 26 27 |
# File 'lib/yahoo-se/pages.rb', line 21 def initialize(domain, ={}) @domain = domain @options = @options[:query] = domain @options[:results] = @options[:results] ||= 50 @options[:start] = @options[:start] ||= 1 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Yahoo::SE::Paginator
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
19 20 21 |
# File 'lib/yahoo-se/pages.rb', line 19 def @options end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
18 19 20 |
# File 'lib/yahoo-se/pages.rb', line 18 def request @request end |
Instance Method Details
#results ⇒ Object
Displays the results for pages data
30 31 32 33 34 |
# File 'lib/yahoo-se/pages.rb', line 30 def results raise ApplicationIDNotSet if Yahoo::SE.application_id.nil? @request = Yahoo::SE::Request.new(Yahoo::SE::Pages::SERVICE_PATH, @options) @results = @request.results end |