Class: NNEClient::ResultSet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/nne_client/result_set.rb

Overview

A ResultSet holds the results returned by the SOAP API. The ResultSet includes Enumerable so it is possible to use all the regular enumerable methods to iterate over it.

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ResultSet

Returns a new instance of ResultSet.



7
8
9
# File 'lib/nne_client/result_set.rb', line 7

def initialize(result)
  @result = result
end

Instance Method Details

#eachObject

Yield each result in turn



12
13
14
15
16
# File 'lib/nne_client/result_set.rb', line 12

def each
  company_basic.each do |cb|
    yield Result.new(cb)
  end
end

#totalObject



25
26
27
# File 'lib/nne_client/result_set.rb', line 25

def total
  window[:total].to_i
end