class AWS::SimpleDB::Item
item = AWS::SimpleDB.new.domains.items[‘item-id’]
order to add, remove, or read the item’s attributes.
use it to access the {AttributeCollection} for the item in
this class to delete the item or get its data. You can also
Represents a single item in a SimpleDB domain. You can use
def == other
def == other other.is_a?(Item) and other.domain == domain and other.name == name end
def attributes
-
(AttributeCollection)
- A collection representing all attributes
def attributes AttributeCollection.new(self) end
def data options = {}
-
(ItemData)
- An object with all of the loaded attribute names
def data options = {} get_opts = {} get_opts[:domain_name] = domain.name get_opts[:item_name] = name get_opts[:consistent_read] = consistent_read(options) r = client.get_attributes(get_opts) ItemData.new(:name => name, :domain => domain, :response_object => r) end
def delete options = {}
-
(nil)
-
Options Hash:
(**options)
-
:unless
(String, Symbol
) -- Pass an attribute name. This -
:if
(Hash
) -- Pass a hash with a single key (attribute
Parameters:
-
options
(Hash
) --
def delete options = {} delete_opts = {} delete_opts[:domain_name] = domain.name delete_opts[:item_name] = name delete_opts[:expected] = expect_condition_opts(options) delete_opts.delete(:expected) if delete_opts[:expected].empty? client.delete_attributes(delete_opts) nil end
def initialize domain, name, options = {}
-
options
(Hash
) -- -
name
(String
) -- The name of the item in SimpleDB. -
domain
(Domain
) -- The domain the item belongs to
def initialize domain, name, options = {} @domain = domain @name = name super end