mlangenberg-googlesearch 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/googlesearch.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'googlesearch'
3
- s.version = '0.0.5'
3
+ s.version = '0.0.6'
4
4
  s.date = '2009-01-14'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.has_rdoc = false
@@ -1,13 +1,13 @@
1
1
  class SearchResponse
2
2
  attr_reader :total_server_time, :total_number_of_results, :results, :index_of_first_result, :index_of_last_result, :requested_number_of_search_results
3
- def initialize(xml, requested_number_of_search_results = 10)
3
+ def initialize(xml, requested_number_of_search_results=nil)
4
4
  doc = Nokogiri::XML(xml)
5
5
  @total_server_time = doc.root.xpath('TM').text.to_f
6
6
  @index_of_first_result = doc.root.xpath('RES/@SN').text.to_i
7
7
  @index_of_last_result = doc.root.xpath('RES/@EN').text.to_i
8
8
  @total_number_of_results = doc.root.xpath('RES/M').text.to_i
9
9
  @results = doc.root.xpath('RES//R').map { |res_doc| SearchResult.new(res_doc) }
10
- @requested_number_of_search_results = requested_number_of_search_results
10
+ @requested_number_of_search_results = requested_number_of_search_results ||= 10
11
11
  end
12
12
 
13
13
  def number_of_pages
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mlangenberg-googlesearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Heino