Class: Fog::Rackspace::Servers::Images
- Inherits:
-
Collection
- Object
- Array
- Collection
- Fog::Rackspace::Servers::Images
- Defined in:
- lib/fog/rackspace/models/servers/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
#all ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fog/rackspace/models/servers/images.rb', line 17 def all if @loaded clear end @loaded = true data = connection.list_images_detail.body images = [] for image in data['images'] images << new(image) end if server images = images.select {|image| image.server_id == server.id} end self.replace(images) end |
#get(image_id) ⇒ Object
33 34 35 36 37 |
# File 'lib/fog/rackspace/models/servers/images.rb', line 33 def get(image_id) connection.get_image_details(image_id) rescue Excon::Errors::NotFound nil end |