Sha256: 11ece03e9f26910641cb7b61f6da8862dd140ef15f139e76d8cab286b8d7b317

Contents?: true

Size: 471 Bytes

Versions: 8

Compression:

Stored size: 471 Bytes

Contents

require 'fog/collection'
require 'fog/slicehost/models/compute/image'

module Fog
  module Slicehost
    class Compute

      class Images < Fog::Collection

        model Fog::Slicehost::Compute::Image

        def all
          data = connection.get_images.body['images']
          load(data)
        end

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

      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fog-0.3.7 lib/fog/slicehost/models/compute/images.rb
fog-0.3.6 lib/fog/slicehost/models/compute/images.rb
fog-0.3.5 lib/fog/slicehost/models/compute/images.rb
fog-0.3.4 lib/fog/slicehost/models/compute/images.rb
fog-0.3.3 lib/fog/slicehost/models/compute/images.rb
fog-0.3.2 lib/fog/slicehost/models/compute/images.rb
fog-0.3.1 lib/fog/slicehost/models/compute/images.rb
fog-0.3.0 lib/fog/slicehost/models/compute/images.rb