Sha256: 10526004c8ea8f4ddc20613762dd2d37c5041d68ff60ec91c608dd5a1f7533be

Contents?: true

Size: 533 Bytes

Versions: 7

Compression:

Stored size: 533 Bytes

Contents

require 'fog/core/collection'
require 'fog/compute/models/voxel/image'

module Fog
  module Voxel
    class Compute

      class Images < Fog::Collection

        model Fog::Voxel::Compute::Image

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

        def get(image_id)
          data = connection.images_list(image_id).body['images']

          if data.empty?
            nil
          else
            new(data.first)
          end
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/compute/models/voxel/images.rb
fog-0.8.1 lib/fog/compute/models/voxel/images.rb
fog-0.8.0 lib/fog/compute/models/voxel/images.rb
fog-0.7.2 lib/fog/compute/models/voxel/images.rb
fog-0.7.1 lib/fog/compute/models/voxel/images.rb
fog-0.7.0 lib/fog/compute/models/voxel/images.rb
fog-0.6.0 lib/fog/compute/models/voxel/images.rb