Class: SwiftStorage::ContainerCollection

Inherits:
Node
  • Object
show all
Defined in:
lib/swift_storage/container_collection.rb

Instance Attribute Summary

Attributes inherited from Node

#name, #parent

Instance Method Summary collapse

Methods inherited from Node

#clear_cache, #delete, #delete_if_exists, #exists?, #get_lines, #headers, #initialize, #metadata, #relative_path, #request, #service, #to_s

Methods included from Utils

#hmac, #sig_to_hex, #struct

Constructor Details

This class inherits a constructor from SwiftStorage::Node

Instance Method Details

#[](name) ⇒ SwiftStorage::Object

Note:

This always return a container, regadeless of it's existence on the server. This call do NOT contact the server.

Return a particular container

Parameters:

  • name (String)

    The name (sometimes named key) of the container

Returns:



28
29
30
# File 'lib/swift_storage/container_collection.rb', line 28

def [](name)
  SwiftStorage::Container.new(service, name) if name
end

#allArray<SwiftStorage::Container>

Note:

This method will return only the first 1000 containers.

Return all containers

Returns:



13
14
15
# File 'lib/swift_storage/container_collection.rb', line 13

def all
  get_lines('').map { |name| SwiftStorage::Container.new(service, name)}
end