Class: AWS::SimpleDB::ItemData
- Inherits:
-
Object
- Object
- AWS::SimpleDB::ItemData
- Defined in:
- lib/aws/simple_db/item_data.rb
Overview
Holds the data for a SimpleDB item. While Item only proxies requests to return data, this class actually stores data returned by a query. For example, you can use this to get the list of items whose titles are palindromes using only a single request to SimpleDB (not counting pagination):
items.enum_for(:select).
select { |data| data.title == data.title.to_s.reverse }.
map { |data| data.item }
The AWS::SimpleDB::ItemCollection#select call yields instances of ItemData, and the map
call in the example above gets the list of corresponding Item instances.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
readonly
A hash of attribute names to arrays of values.
-
#domain ⇒ Domain
readonly
The domain from which the item data was retrieved.
-
#name ⇒ String
readonly
The item name.
Instance Method Summary collapse
-
#item ⇒ Item
Returns the Item corresponding to this ItemData; you can use this to perform further operations on the item, or to fetch its most recent data.
Instance Attribute Details
#attributes ⇒ Hash (readonly)
Returns A hash of attribute names to arrays of values.
54 55 56 |
# File 'lib/aws/simple_db/item_data.rb', line 54 def attributes @attributes end |
#domain ⇒ Domain (readonly)
Returns The domain from which the item data was retrieved.
57 58 59 |
# File 'lib/aws/simple_db/item_data.rb', line 57 def domain @domain end |
#name ⇒ String (readonly)
Returns The item name.
51 52 53 |
# File 'lib/aws/simple_db/item_data.rb', line 51 def name @name end |
Instance Method Details
#item ⇒ Item
Returns the AWS::SimpleDB::Item corresponding to this ItemData; you can use this to perform further operations on the item, or to fetch its most recent data.
63 64 65 |
# File 'lib/aws/simple_db/item_data.rb', line 63 def item domain.items[name] end |