Sha256: 9241137995a080ca147b034a4604df1ffa560b331dd80d725102405fe9521c10

Contents?: true

Size: 1.47 KB

Versions: 30

Compression:

Stored size: 1.47 KB

Contents

module Fog
  module Parsers
    module AWS
      module ELBV2
        class DescribeTags < Fog::Parsers::Base
          def reset
            @this_key   = nil
            @this_value = nil
            @tags       = Hash.new
            @response   = { 'DescribeTagsResult' => { 'TagDescriptions' => [] }, 'ResponseMetadata' => {} }
            @in_tags = false
          end

          def start_element(name, attrs = [])
            super
            case name
              when 'member'
                unless @in_tags
                  @resource_arn = nil
                  @tags = {}
                end
              when 'Tags'
                @in_tags = true
            end
          end

          def end_element(name)
            super
            case name
              when 'member'
                if @in_tags
                  @tags[@this_key] = @this_value
                  @this_key, @this_value = nil, nil
                else
                  @response['DescribeTagsResult']['TagDescriptions'] << { 'Tags' => @tags, 'ResourceArn' => @resource_arn }
                end
              when 'Key'
                @this_key = value
              when 'Value'
                @this_value = value
              when 'ResourceArn'
                @resource_arn = value
              when 'RequestId'
                @response['ResponseMetadata'][name] = value
              when 'Tags'
                @in_tags = false
            end
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fog-aws-3.10.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.9.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.8.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.7.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.7 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.6 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.5 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.4 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.3 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.6.2 lib/fog/aws/parsers/elbv2/describe_tags.rb