Method: Aws::ActiveSdb::Base#save_attributes

Defined in:
lib/sdb/active_sdb.rb

#save_attributes(attrs) ⇒ Object

Replaces the attributes at SDB by the given values. Attrs is a hash: { attribute1 => values1, …, attributeN => valuesN }. The other in-memory attributes are not being saved. Returns a hash of stored attributes.

see save method



874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/sdb/active_sdb.rb', line 874

def save_attributes(attrs)
    prepare_for_update
    attrs = uniq_values(attrs)
    # if 'id' is present in attrs hash then replace internal 'id' attribute
    unless attrs['id'].blank?
        @attributes['id'] = attrs['id']
    else
        attrs['id'] = id
    end
    connection.put_attributes(domain, id, attrs, :replace) unless attrs.blank?
    attrs.each { |attribute, values| attrs[attribute] = values }
    mark_as_old
    attrs
end