lib/amazon_sdb/domain.rb
##
# Sets attributes for a given key in the domain. If there are no attributes supplied, it creates an empty set.
# Takes the following arguments:
# - <tt>key</tt> - a string key for the attribute set
# - <tt>multimap</tt> - an collection of attributes for the set in a Multimap object (can convert a Hash and Array too). If nothing, creates an empty set.
# - <tt>options</tt> - for put options. Currently the only option is :replace, which either takes an array of attribute names to replace or :all for all of them
Sets attributes for a given key in the domain. If there are no attributes supplied, it creates an empty set.
Takes the following arguments:
key - a string key for the attribute set
multimap - an collection of attributes for the set in a Multimap object (can convert a Hash and Array too). If nothing, creates an empty set.
options - for put options. Currently the only option is :replace, which either takes an array of attribute names to replace or :all for all of them
Sets attributes for a given key in the domain . If there are no attributes supplied it creates an empty set . Takes the following arguments : key - a string key for the attribute set multimap - an collection of attributes for the set in a Multimap object ( can convert a Hash and Array too ) . If nothing creates an empty set . options - for put options . Currently the only option is : replace which either takes an array of attribute names to replace or : all for all of them
def put_attributes(key, multimap=nil, options = {})
        req_options = {'Action' => 'PutAttributes', 'DomainName' => name, 'ItemName' => key}
        unless multimap.nil?
          req_options.merge! case multimap
          when Hash, Array
            Multimap.new(multimap).to_sdb(options)
          when Multimap
            multimap.to_sdb(options)
          else
            raise ArgumentError, "The second argument must be a multimap, hash, or array"
          end
        end
        sdb_query(req_options) do |h|
          if h.search('//Success').any?
            return Item.new(self, key, multimap)
          else
          end
        end
      end
def put_attributes ( key , multimap = nil , options = { } ) req_options = { 'Action' => 'PutAttributes' , 'DomainName' => name , 'ItemName' => key } unless multimap . nil? req_options . merge! case multimap when Hash , Array Multimap . new ( multimap ) . to_sdb ( options ) when Multimap multimap . to_sdb ( options ) else raise ArgumentError , "The second argument must be a multimap, hash, or array" end end sdb_query ( req_options ) do | h | if h . search ( '//Success' ) . any? return Item . new ( self , key , multimap ) else end end end
Sets attributes for a given key in the domain.
Sets attributes for a given key in the domain .
# check for success? # error?
key
multimap
options