Sha256: b409cdd27eb632ec553d26d1abe65fc64499a4f23fd058f6d421a495495c6ce8

Contents?: true

Size: 1.83 KB

Versions: 98

Compression:

Stored size: 1.83 KB

Contents

module Fog
  module Parsers
    module AWS
      module ELB
        class DescribeLoadBalancerPolicies < Fog::Parsers::Base
          def reset
            reset_policy
            reset_policy_attribute_description
            @results = { 'PolicyDescriptions' => [] }
            @response = { 'DescribeLoadBalancerPoliciesResult' => {}, 'ResponseMetadata' => {} }
          end

          def reset_policy
            @policy = { 'PolicyAttributeDescriptions' => [], 'PolicyName' => '', 'PolicyTypeName' => '' }
          end

          def reset_policy_attribute_description
            @policy_attribute_description = { 'AttributeName' => '', 'AttributeValue' => '' }
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'PolicyAttributeDescriptions'
              @in_policy_attributes = true
            end
          end

          def end_element(name)
            case name
            when 'member'
              if @in_policy_attributes
                @policy['PolicyAttributeDescriptions'] << @policy_attribute_description
                reset_policy_attribute_description
              elsif !@in_policy_attributes
                @results['PolicyDescriptions'] << @policy
                reset_policy
              end

            when 'PolicyName', 'PolicyTypeName'
              @policy[name] = value

            when 'PolicyAttributeDescriptions'
              @in_policy_attributes = false

            when 'AttributeName', 'AttributeValue'
              @policy_attribute_description[name] = value

            when 'RequestId'
              @response['ResponseMetadata'][name] = value

            when 'DescribeLoadBalancerPoliciesResponse'
              @response['DescribeLoadBalancerPoliciesResult'] = @results
            end
          end
        end
      end
    end
  end
end

Version data entries

98 entries across 96 versions & 6 rubygems

Version Path
fog-aws-3.11.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.10.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.9.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.8.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.7.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.7 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.6 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.5 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.4 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.3 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.6.2 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.5.2 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.5.1 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.5.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.4.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.3.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.2.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
fog-aws-3.1.0 lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/parsers/elb/describe_load_balancer_policies.rb