Method: OpenStack::Swift::Connection#container

Defined in:
lib/openstack/swift/connection.rb

#container(name) ⇒ Object Also known as: get_container

Returns an OpenStack::Swift::Container object that can be manipulated easily. Throws a OpenStack::Exception::ItemNotFound if the container doesn’t exist.

container = cf.container('test')
container.count
=> 2
container = cf.container("no_such_container")
=> OpenStack::Exception::ItemNotFound: The resource could not be found


33
34
35
# File 'lib/openstack/swift/connection.rb', line 33

def container(name)
  OpenStack::Swift::Container.new(self, name)
end