Class: Deltacloud::Bucket

Inherits:
BaseModel show all
Defined in:
lib/deltacloud/models/bucket.rb

Instance Attribute Summary collapse

Attributes inherited from BaseModel

#description

Instance Method Summary collapse

Methods inherited from BaseModel

attr_accessor, attributes, #attributes, #id, #initialize, #to_entity

Constructor Details

This class inherits a constructor from Deltacloud::BaseModel

Instance Attribute Details

#blob_listObject

Returns the value of attribute blob_list.



22
23
24
# File 'lib/deltacloud/models/bucket.rb', line 22

def blob_list
  @blob_list
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/deltacloud/models/bucket.rb', line 20

def name
  @name
end

#sizeObject

Returns the value of attribute size.



21
22
23
# File 'lib/deltacloud/models/bucket.rb', line 21

def size
  @size
end

Instance Method Details

#to_hash(context) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/deltacloud/models/bucket.rb', line 28

def to_hash(context)
  {
    :id => self.id,
    :href => context.bucket_url(self.id),
    :name => name,
    :size => size,
    :blob_list => blob_list.map { |b| {
      :rel => :blob,
      :href => context.url("/buckets/#{self.id}/#{b}"), :id => b }
    }
  }
end