Method: Fog::Parsers::AWS::AutoScaling::DescribePolicies#end_element

Defined in:
lib/fog/aws/parsers/auto_scaling/describe_policies.rb

#end_element(name) ⇒ Object



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
58
59
60
61
62
# File 'lib/fog/aws/parsers/auto_scaling/describe_policies.rb', line 32

def end_element(name)
  case name
  when 'AlarmARN', 'AlarmName'
    @alarm[name] = value

  when 'AdjustmentType', 'AutoScalingGroupName', 'PolicyARN', 'PolicyName'
    @scaling_policy[name] = value
  when 'Cooldown', 'MinAdjustmentStep', 'ScalingAdjustment'
    @scaling_policy[name] = value.to_i

  when 'NextToken'
    @results[name] = value

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

  when 'DescribePoliciesResponse'
    @response['DescribePoliciesResult'] = @results

  when 'Alarms'
    @in_alarms = false
  when 'member'
    if @in_alarms
      @scaling_policy['Alarms'] << @alarm
      reset_alarm
    else
      @results['ScalingPolicies'] << @scaling_policy
      reset_scaling_policy
    end
  end
end