class AWS::SimpleDB::Domain


@see DomainCollection
domain = SimpleDB.new.domains[‘mydomain’]

@example Getting a domain
domain = SimpleDB.new.domains.create(‘mydomain’)
@example Creating a domain
Domains, like database tables, must exist before you can write to one.
Represents a domain in SimpleDB.

def == other

Returns:
  • (Boolean) - Returns true if the domains are the same.
def == other
  other.is_a?(Domain) and
  other.name == name and
  other.config.simple_db_endpoint == config.simple_db_endpoint
end

def delete

Returns:
  • (nil) -

Raises:
  • (NonEmptyDeleteError) - Raises if the domain is not empty.

Other tags:
    Note: - If you need to delete a domain with items, call {#delete!}
def delete
  unless empty?
    raise NonEmptyDeleteError, "delete called without :force " +
     "on a non-empty domain"
  end
  client.delete_domain(:domain_name => name)
  nil
end

def delete!

Returns:
  • (nil) -
def delete!
  client.delete_domain(:domain_name => name)
  nil
end

def empty?

Returns:
  • (Boolean) - Returns true if the domain has no items.
def empty?
  metadata.item_count == 0
end

def exists?

Returns:
  • (Boolean) - Returns true if the domain exists.
def exists?
  begin
    client.domain_metadata(:domain_name => name)
    true
  rescue Errors::NoSuchDomain
    false
  end
end

def initialize(name, options = {})

Parameters:
  • name (String) -- The name of a SimpleDB domain to reference.
def initialize(name, options = {})
  super(options)
  @name = name
end

def inspect

Other tags:
    Api: - private

Returns:
  • (String) -
def inspect
  "#<#{self.class}:#{name}>"
end

def items

Returns:
  • (ItemCollection) -
def items
  ItemCollection.new(self)
end

def metadata

Returns:
  • (DomainMetadata) -
def metadata
  DomainMetadata.new(self)
end