Sha256: 2e8ece7d695836d45661e5091571464b13acfe0f4a2732b9206c549669db11ee

Contents?: true

Size: 953 Bytes

Versions: 11

Compression:

Stored size: 953 Bytes

Contents

require 'fog/core/collection'
require 'fog/terremark/models/shared/image'

module Fog
  module Terremark
    module Shared


      module Mock
        def images(options = {})
          Fog::Terremark::Shared::Images.new(options.merge(:connection => self))
        end
      end

      module Real
        def images(options = {})
          Fog::Terremark::Shared::Images.new(options.merge(:connection => self))
        end
      end

      class Images < Fog::Collection


        model Fog::Terremark::Shared::Image 

        def all
          data = connection.get_catalog(vdc_id).body['CatalogItems'].select do |entity|
            entity['type'] == "application/vnd.vmware.vcloud.catalogItem+xml"
          end
          load(data)
        end


        def vdc_id
          @vdc_id ||= connection.default_vdc_id
        end

        private

        def vdc_id=(new_vdc_id)
          @vdc_id = new_vdc_id
        end

      end

    end
  end
end

Version data entries

11 entries across 11 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/terremark/models/shared/images.rb
fog-nirvanix-1.8.1 lib/fog/terremark/models/shared/images.rb
fog-parser-fix-1.6.1 lib/fog/terremark/models/shared/images.rb
fog-test-again-1.6.0 lib/fog/terremark/models/shared/images.rb
fog-parser-fix-1.6.0 lib/fog/terremark/models/shared/images.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/terremark/models/shared/images.rb
fog-sgonyea-1.8.1 lib/fog/terremark/models/shared/images.rb
fog-1.8.0 lib/fog/terremark/models/shared/images.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/terremark/models/shared/images.rb
fog-1.7.0 lib/fog/terremark/models/shared/images.rb
fog-1.6.0 lib/fog/terremark/models/shared/images.rb