Class Fog::Storage::Rackspace::Mock::MockObject
In: lib/fog/rackspace/storage.rb
Parent: Object

An in-memory Swift object.

Methods

Attributes

body  [R] 
bytes_used  [R] 
content_type  [R] 
hash  [R] 
last_modified  [R] 
meta  [R] 
service  [R] 
static_manifest  [RW] 

Public Class methods

Construct a new object. Generally, you should call {MockContainer#add_object} instead of instantiating these directly.

Public Instance methods

Determine if this object has the metadata header that marks it as a dynamic large object manifest.

@return [Boolean]

Iterate through each MockObject that contains a part of the data for this logical object. In the normal case, this will only yield the receiver directly. For dynamic and static large object manifests, however, this call will yield each MockObject that contains a part of the whole, in sequence.

Manifests that refer to containers or objects that don‘t exist will skip those sections and log a warning, instead.

@yield [MockObject] Each object that holds a part of this logical

  object.

Access the object name prefix that controls which other objects comprise a dynamic large object.

@return [String, nil] The object name prefix, or `nil` if none is

  present.

Determine if this object was created as a static large object manifest.

@return [Boolean]

Construct the fake HTTP headers that should be returned on requests targetting this object. Includes computed `Content-Type`, `Content-Length`, `Last-Modified` and `ETag` headers in addition to whatever metadata has been associated with this object manually.

@return [Hash<String, String>] Header values stored in a Hash.

[Validate]