Sha256: 3ebaf4b1fadcddb1a6ad33e18be1d5f4e53f49c48b11e43911b006fa54f99ebb

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

module Fog
  module Vcloud
    module Terremark
      module Ecloud

        module Mock
          def public_ips(options = {})
            @public_ips ||= Fog::Vcloud::Terremark::Ecloud::PublicIps.new(options.merge(:connection => self))
          end
        end

        module Real
          def public_ips(options = {})
            @public_ips ||= Fog::Vcloud::Terremark::Ecloud::PublicIps.new(options.merge(:connection => self))
          end
        end

        class PublicIps < Fog::Vcloud::Collection

          undef_method :create

          attribute :href, :aliases => :Href

          model Fog::Vcloud::Terremark::Ecloud::PublicIp

          #get_request :get_public_ip
          #vcloud_type "application/vnd.tmrk.ecloud.publicIp+xml"
          #all_request lambda { |public_ips| public_ips.connection.get_public_ips(public_ips.href) }

          def all
            if data = connection.get_public_ips(href).body[:PublicIPAddress]
              load(data)
            end
          end

          def get(uri)
            if data = connection.get_public_ip(uri)
              new(data.body)
            end
          rescue Fog::Errors::NotFound
            nil
          end

        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.28 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.27 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.26 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.25 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.24 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
tecnh-fog-0.2.23.vpc lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.23 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.22 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.21 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.20 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.19 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.18 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.17 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.16 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.15 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.14 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.13 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.12 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb
fog-0.2.11 lib/fog/vcloud/terremark/ecloud/models/public_ips.rb