Class: Fog::Slicehost::Images

Inherits:
Collection show all
Defined in:
lib/fog/slicehost/models/images.rb

Instance Method Summary collapse

Methods inherited from Collection

#_dump, _load, aliases, attribute, attributes, #attributes, #connection, #connection=, #create, #initialize, #inspect, #merge_attributes, model, #model, #new, #reload

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Method Details

#allObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fog/slicehost/models/images.rb', line 14

def all
  if @loaded
    clear
  end
  @loaded = true
  data = connection.get_images.body
  for image in data['images']
    self << new(image)
  end
  self
end

#get(image_id) ⇒ Object



26
27
28
29
30
# File 'lib/fog/slicehost/models/images.rb', line 26

def get(image_id)
  connection.get_image(image_id)
rescue Excon::Errors::Forbidden
  nil
end