Sha256: 3381006adfddc1d465bf5bda234d4bb415e55019eccb2a4521ec889058649056
Contents?: true
Size: 680 Bytes
Versions: 7
Compression:
Stored size: 680 Bytes
Contents
require 'fog/core/collection' require 'fog/compute/models/rackspace/image' module Fog module Compute class Rackspace class Images < Fog::Collection model Fog::Compute::Rackspace::Image attribute :server def all data = connection.list_images_detail.body['images'] load(data) if server self.replace(self.select {|image| image.server_id == server.id}) end end def get(image_id) data = connection.get_image_details(image_id).body['image'] new(data) rescue Fog::Compute::Rackspace::NotFound nil end end end end end
Version data entries
7 entries across 7 versions & 3 rubygems