Sha256: 90729d208a7317a45fd782c71ddf0a450d5fe0974b2ab211aa25ef8cd221cd3f

Contents?: true

Size: 1.05 KB

Versions: 12

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Parsers
    module Vcloud

      class Login < Fog::Parsers::Base
        #
        # Based off of:
        # http://support.theenterprisecloud.com/kb/default.asp?id=536&Lang=1&SID=
        # https://community.vcloudexpress.terremark.com/en-us/product_docs/w/wiki/01-get-login-token.aspx
        # vCloud API Guide v0.9 - Page 17
        #

        def reset
          @response = Struct::VcloudOrgList.new([])
        end

        def start_element(name, attributes)
          @value = ''
          case name
          when 'OrgList'
            until attributes.empty?
              if at = attributes.shift
                if at[0] == "xmlns"
                  @response.xmlns = at[1]
                end
              end
            end
          when 'Org'
            organization = Struct::VcloudOrgLink.new
            until attributes.empty?
              organization[attributes.shift.downcase.to_sym] = attributes.shift
            end
            @response.organizations << organization
          end
        end

      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fog-0.1.4 lib/fog/vcloud/parsers/login.rb
fog-0.1.3 lib/fog/vcloud/parsers/login.rb
fog-0.1.2 lib/fog/vcloud/parsers/login.rb
fog-0.1.1 lib/fog/vcloud/parsers/login.rb
fog-0.1.0 lib/fog/vcloud/parsers/login.rb
fog-0.0.100 lib/fog/vcloud/parsers/login.rb
fog-0.0.99 lib/fog/vcloud/parsers/login.rb
fog-0.0.98 lib/fog/vcloud/parsers/login.rb
fog-0.0.97 lib/fog/vcloud/parsers/login.rb
fog-0.0.96 lib/fog/vcloud/parsers/login.rb
fog-0.0.95 lib/fog/vcloud/parsers/login.rb
fog-0.0.94 lib/fog/vcloud/parsers/login.rb