Class: SwiftStorage::ObjectCollection
- Defined in:
- lib/swift_storage/object_collection.rb
Constant Summary
Constants included from Headers
Headers::ACCOUNT_TEMP_URL_KEY, Headers::AUTH_KEY, Headers::AUTH_TOKEN, Headers::AUTH_USER, Headers::CACHE_CONTROL, Headers::CONNECTION, Headers::CONTAINER_READ, Headers::CONTAINER_WRITE, Headers::CONTENT_DISPOSITION, Headers::CONTENT_TYPE, Headers::DELETE_AFTER, Headers::DELETE_AT, Headers::DESTINATION, Headers::EXPIRES, Headers::OBJECT_MANIFEST, Headers::PROXY_CONNECTION, Headers::STORAGE_TOKEN, Headers::STORAGE_URL
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#[](name) ⇒ SwiftStorage::Object
Return a particular object.
-
#all ⇒ Array<SwiftStorage::Object>
Return all objects.
- #with_prefix(prefix) ⇒ Object
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
Constructor Details
This class inherits a constructor from SwiftStorage::Node
Instance Method Details
#[](name) ⇒ SwiftStorage::Object
This always return an object, regadeless of it's existence on the server. This call do NOT contact the server.
Return a particular object
26 27 28 |
# File 'lib/swift_storage/object_collection.rb', line 26 def [](name) SwiftStorage::Object.new(container, name) if name end |
#all ⇒ Array<SwiftStorage::Object>
This method will return only the first 1000 objects.
Return all objects
11 12 13 |
# File 'lib/swift_storage/object_collection.rb', line 11 def all get_objects end |
#with_prefix(prefix) ⇒ Object
30 31 32 |
# File 'lib/swift_storage/object_collection.rb', line 30 def with_prefix(prefix) get_objects(prefix) end |