lib/sdb/active_sdb.rb
# Stores in-memory attributes to SDB.
# Adds the attributes values to already stored at SDB.
# Returns a hash of stored attributes. 
#
#  sandy = Client.new(:name => 'Sandy') #=> #<Client:0xb775a7a8 @attributes={"name"=>["Sandy"]}, @new_record=true>
#  sandy['toys'] = 'boys'
#  sandy.put
#  sandy['toys'] = 'patchwork'
#  sandy.put
#  sandy['toys'] = 'kids'
#  sandy.put
#  puts sandy.attributes.inspect        #=> {"name"=>["Sandy"], "id"=>"b2832ce2-e461-11dc-b13c-001bfc466dd7", "toys"=>["kids"]}
#  sandy.reload                         #=> {"name"=>["Sandy"], "id"=>"b2832ce2-e461-11dc-b13c-001bfc466dd7", "toys"=>["boys", "kids", "patchwork"]}
#
# compare to +save+ method
Stores in-memory attributes to SDB.
Adds the attributes values to already stored at SDB.
Returns a hash of stored attributes.



compare to +save+ method
Stores in - memory attributes to SDB . Adds the attributes values to already stored at SDB . Returns a hash of stored attributes . compare to + save + method
def put
        @attributes = uniq_values(@attributes)
        prepare_for_update
        attrs = @attributes.dup
        attrs.delete('id')
        connection.put_attributes(domain, id, attrs) unless attrs.right_blank?
        connection.put_attributes(domain, id, { 'id' => id }, :replace)
        mark_as_old
        @attributes
      end
def put @attributes = uniq_values ( @attributes ) prepare_for_update attrs = @attributes . dup attrs . delete ( 'id' ) connection . put_attributes ( domain , id , attrs ) unless attrs . right_blank? connection . put_attributes ( domain , id , { 'id' => id } , :replace ) mark_as_old @attributes end
Stores in-memory attributes to SDB.
Stores in - memory attributes to SDB .