Class: Fog::Parsers::AWS::ELB::DescribeLoadBalancerPolicies

Inherits:
Base
  • Object
show all
Defined in:
lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #initialize, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb', line 31

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

#resetObject



8
9
10
11
12
13
# File 'lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb', line 8

def reset
  reset_policy
  reset_policy_attribute_description
  @results = { 'PolicyDescriptions' => [] }
  @response = { 'DescribeLoadBalancerPoliciesResult' => {}, 'ResponseMetadata' => {} }
end

#reset_policyObject



15
16
17
# File 'lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb', line 15

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

#reset_policy_attribute_descriptionObject



19
20
21
# File 'lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb', line 19

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

#start_element(name, attrs = []) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/rackspace-fog/aws/parsers/elb/describe_load_balancer_policies.rb', line 23

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