Method: Image#to_hash

Defined in:
lib/deltacloud/models/image.rb

#to_hash(context) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/deltacloud/models/image.rb', line 33

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