Class: NNEClient::ResultSet
- Inherits:
-
Object
- Object
- NNEClient::ResultSet
- 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
-
#each ⇒ Object
Yield each result in turn.
-
#initialize(result) ⇒ ResultSet
constructor
A new instance of ResultSet.
- #total ⇒ Object
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
#each ⇒ Object
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 |
#total ⇒ Object
25 26 27 |
# File 'lib/nne_client/result_set.rb', line 25 def total window[:total].to_i end |