vendor/bundle/ruby/1.8/gems/aws-2.5.6/lib/sdb/active_sdb.rb
# Store in-memory attributes to SDB.
# Replaces the attributes values already stored at SDB by in-memory data.
# Returns a hash of stored attributes.
#
#  sandy = Client.new(:name => 'Sandy')  #=> #<Client:0xb775a7a8 @attributes={"name"=>["Sandy"]}, @new_record=true>
#  sandy['toys'] = 'boys'
#  sandy.save
#  sandy['toys'] = 'patchwork'
#  sandy.save
#  sandy['toys'] = 'kids'
#  sandy.save
#  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"=>["kids"]}
#
# Options:
#   - :except => Array of attributes to NOT save
#
# compare to +put+ method
Store in-memory attributes to SDB.
Replaces the attributes values already stored at SDB by in-memory data.
Returns a hash of stored attributes.



:except => Array of attributes to NOT save

compare to +put+ method
Store in - memory attributes to SDB . Replaces the attributes values already stored at SDB by in - memory data . Returns a hash of stored attributes . : except = > Array of attributes to NOT save compare to + put + method
def save(options={})
                pre_save2
                atts_to_save = @attributes.dup
                if options[:except]
                    options[:except].each do |e|
                        atts_to_save.delete(e).inspect
                    end
                end
                if options[:dirty] 
                    dirty_atts = options[:dirty_atts]
                    atts_to_save.delete_if { |key, value| !dirty_atts.has_key?(key) }
                end
                connection.put_attributes(domain, id, atts_to_save, :replace)
                apres_save2
                @attributes
            end
def save ( options = { } ) pre_save2 atts_to_save = @attributes . dup if options [ :except ] options [ :except ] . each do | e | atts_to_save . delete ( e ) . inspect end end if options [ :dirty ] dirty_atts = options [ :dirty_atts ] atts_to_save . delete_if { | key , value | ! dirty_atts . has_key? ( key ) } end connection . put_attributes ( domain , id , atts_to_save , :replace ) apres_save2 @attributes end
Store in-memory attributes to SDB.
Store in - memory attributes to SDB .
#puts 'atts_to_save=' + atts_to_save.inspect #options = params.first.is_a?(Hash) ? params.pop : {} # Only used in simple_record right now # only save if the attribute is dirty #puts 'atts_to_save2=' + atts_to_save.inspect
options