Class: Image

Inherits:
BaseModel show all
Includes:
TestPoller
Defined in:
lib/deltacloud/api.rb,
lib/deltacloud/models/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TestPoller

#wait_for!

Methods inherited from BaseModel

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

Constructor Details

This class inherits a constructor from BaseModel

Instance Attribute Details

#architectureObject

Returns the value of attribute architecture.



23
24
25
# File 'lib/deltacloud/models/image.rb', line 23

def architecture
  @architecture
end

#creation_timeObject

Returns the value of attribute creation_time.



26
27
28
# File 'lib/deltacloud/models/image.rb', line 26

def creation_time
  @creation_time
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#hardware_profilesObject

Returns the value of attribute hardware_profiles.



25
26
27
# File 'lib/deltacloud/models/image.rb', line 25

def hardware_profiles
  @hardware_profiles
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#owner_idObject

Returns the value of attribute owner_id.



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

def owner_id
  @owner_id
end

#stateObject

Returns the value of attribute state.



24
25
26
# File 'lib/deltacloud/models/image.rb', line 24

def state
  @state
end

Instance Method Details

#to_hash(context) ⇒ Object



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

def to_hash(context)
  {
    :id => self.id,
    :name => name,
    :description => description,
    :owner => owner_id,
    :architecture => architecture,
    :state => state,
    :creation_time => creation_time,
    :hardware_profiles => hardware_profiles.map { |p|
      { :id => p.id, :href => context.hardware_profile_url(p.id), :rel => :hardware_profile }
    }
  }
end