Class: Amazon::SDB::ResultSet
- Inherits:
-
Object
- Object
- Amazon::SDB::ResultSet
- Includes:
- Enumerable
- Defined in:
- lib/amazon_sdb/resultset.rb
Overview
Represents a ResultSet returned from Domain#query. Currently, this is just a set of Items plus an operation to see if there is another set to be retrieved and to load it on demand. When Amazon sees fit to add total results or other metadata for queries that will also be included here.
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#each ⇒ Object
Support method for Enumerable.
-
#initialize(domain, items, more_token = nil) ⇒ ResultSet
constructor
A new instance of ResultSet.
-
#keys ⇒ Object
Iterator through all the keys in this resultset.
-
#load_next! ⇒ Object
Not implemented yet.
-
#more_items? ⇒ Boolean
Returns true if there is another result set to be loaded.
Constructor Details
#initialize(domain, items, more_token = nil) ⇒ ResultSet
Returns a new instance of ResultSet.
13 14 15 16 17 |
# File 'lib/amazon_sdb/resultset.rb', line 13 def initialize(domain, items, more_token = nil) @domain = domain @items = items @more_token = more_token end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
11 12 13 |
# File 'lib/amazon_sdb/resultset.rb', line 11 def items @items end |
Instance Method Details
#each ⇒ Object
Support method for Enumerable. Iterates through the items in this set (NOT all the matching results for a query)
38 39 40 41 42 |
# File 'lib/amazon_sdb/resultset.rb', line 38 def each @items.each do |i| yield i end end |
#keys ⇒ Object
Iterator through all the keys in this resultset
32 33 34 |
# File 'lib/amazon_sdb/resultset.rb', line 32 def keys @items.map {|i| i.key } end |
#load_next! ⇒ Object
Not implemented yet
27 28 |
# File 'lib/amazon_sdb/resultset.rb', line 27 def load_next! end |
#more_items? ⇒ Boolean
Returns true if there is another result set to be loaded
21 22 23 |
# File 'lib/amazon_sdb/resultset.rb', line 21 def more_items? not @more_token.nil? end |