Class: Fog::Parsers::AWS::AutoScaling::DescribeMetricCollectionTypes

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb

Instance Method Summary collapse

Instance Method Details

#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
# File 'lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb', line 32

def end_element(name)
  case name
  when 'member'
    if @in_granularities
      @results['Granularities'] << @granularity
      reset_granularity
    elsif @in_metrics
      @results['Metrics'] << @metric
      reset_metric
    end

  when 'Granularity'
     @granularity[name] = value
  when 'Granularities'
     @in_granularities = false

  when 'Metric'
     @metric[name] = value
  when 'Metrics'
     @in_metrics = false

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

  when 'DescribeMetricCollectionTypesResult'
    @response[name] = @results
  end
end

#resetObject



6
7
8
9
10
11
# File 'lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb', line 6

def reset
  reset_granularity
  reset_metric
  @results = { 'Granularities' => [], 'Metrics' => [] }
  @response = { 'DescribeMetricCollectionTypesResult' => {}, 'ResponseMetadata' => {} }
end

#reset_granularityObject



13
14
15
# File 'lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb', line 13

def reset_granularity
  @granularity = {}
end

#reset_metricObject



17
18
19
# File 'lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb', line 17

def reset_metric
  @metric = {}
end

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



21
22
23
24
25
26
27
28
29
30
# File 'lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb', line 21

def start_element(name, attrs = [])
  super

  case name
  when 'Granularities'
    @in_granularities = true
  when 'Metrics'
    @in_metrics = true
  end
end