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.29.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.28.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.27.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.26.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.25.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.24.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.23.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.22.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.21.1 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.21.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.20.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.19.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.18.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.17.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.16.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.15.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.14.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.13.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.12.0 lib/fog/aws/parsers/elbv2/describe_tags.rb
fog-aws-3.11.0 lib/fog/aws/parsers/elbv2/describe_tags.rb