Sha256: aa091685545652b3e5b01343fa7e6c314f9a3191382a135aeed04979e4490fb6

Contents?: true

Size: 678 Bytes

Versions: 4

Compression:

Stored size: 678 Bytes

Contents

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

module Fog
  module AWS
    class Compute

      class Images < Fog::Collection

        attribute :filters

        model Fog::AWS::Compute::Image

        def initialize(attributes)
          self.filters ||= {}
          super
        end

        def all(filters = @filters)
          self.filters = filters
          data = connection.describe_images(filters).body
          load(data['imagesSet'])
        end

        def get(image_id)
          if image_id
            self.class.new(:connection => connection).all('image-id' => image_id).first
          end
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fog-0.3.25 lib/fog/aws/models/compute/images.rb
fog-0.3.24 lib/fog/aws/models/compute/images.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/aws/models/compute/images.rb
fog-0.3.23 lib/fog/aws/models/compute/images.rb