Class: Yahoo::SE::Inlinks

Inherits:
Object
  • Object
show all
Includes:
Paginator
Defined in:
lib/yahoo-se/inlinks.rb

Constant Summary collapse

SERVICE_PATH =
"#{Yahoo::SE::SERVICE_PATH}/inlinkData"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Paginator

#last?, #method_missing, #next, #response, #total_results_available

Constructor Details

#initialize(domain, options = {}) ⇒ Inlinks

Returns a new instance of Inlinks.



21
22
23
24
25
26
27
# File 'lib/yahoo-se/inlinks.rb', line 21

def initialize(domain, options={})
  @domain = domain
  @options = 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

#optionsObject

Returns the value of attribute options.



19
20
21
# File 'lib/yahoo-se/inlinks.rb', line 19

def options
  @options
end

#requestObject (readonly)

Returns the value of attribute request.



18
19
20
# File 'lib/yahoo-se/inlinks.rb', line 18

def request
  @request
end

Instance Method Details

#resultsObject

Displays the results for inlinks data



30
31
32
33
34
# File 'lib/yahoo-se/inlinks.rb', line 30

def results
  raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?
  @request = Yahoo::SE::Request.new(Yahoo::SE::Inlinks::SERVICE_PATH, @options)
  @results = @request.results
end