lib/aws/simple_db/item.rb in aws-sdk-1.1.4 vs lib/aws/simple_db/item.rb in aws-sdk-1.2.0

- old
+ new

@@ -47,10 +47,17 @@ def attributes AttributeCollection.new(self) end # Deletes the item and all of its attributes from SimpleDB. + # @param [Hash] options + # @option options [Hash] :if Pass a hash with a single key (attribute + # name) and a single value (the attribute value). This causes the + # delete to become conditional. + # @option options [String,Symbol] :unless Pass an attribute name. This + # causes the delete to become conditional on that attribute not + # existing. # @return [nil] def delete options = {} delete_opts = {} delete_opts[:domain_name] = domain.name delete_opts[:item_name] = name @@ -69,9 +76,17 @@ 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 == other + other.is_a?(Item) and + other.domain == domain and + other.name == name + end + + alias_method :eql?, :== end end end