Class: Fog::Parsers::AWS::CloudWatch::ListMetrics
- Inherits:
-
Base
- Object
- Base
- Fog::Parsers::AWS::CloudWatch::ListMetrics
- Defined in:
- lib/fog/aws/parsers/cloud_watch/list_metrics.rb
Instance Method Summary collapse
- #end_element(name) ⇒ Object
- #reset ⇒ Object
- #reset_dimension ⇒ Object
- #reset_metric ⇒ Object
- #start_element(name, attrs = []) ⇒ Object
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 |
# File 'lib/fog/aws/parsers/cloud_watch/list_metrics.rb', line 31 def end_element(name) case name when 'Name', 'Value' @dimension[name] = value when 'Namespace', 'MetricName' @metric[name] = value when 'Dimensions' @in_dimensions = false when 'NextMarker', 'NextToken' @response['ListMetricsResult'][name] = value when 'RequestId' @response['ResponseMetadata'][name] = value when 'member' if !@in_dimensions @response['ListMetricsResult']['Metrics'] << @metric reset_metric else @metric['Dimensions'] << @dimension end end end |
#reset ⇒ Object
6 7 8 9 |
# File 'lib/fog/aws/parsers/cloud_watch/list_metrics.rb', line 6 def reset @response = { 'ListMetricsResult' => {'Metrics' => []}, 'ResponseMetadata' => {} } reset_metric end |
#reset_dimension ⇒ Object
15 16 17 |
# File 'lib/fog/aws/parsers/cloud_watch/list_metrics.rb', line 15 def reset_dimension @dimension = {} end |
#reset_metric ⇒ Object
11 12 13 |
# File 'lib/fog/aws/parsers/cloud_watch/list_metrics.rb', line 11 def reset_metric @metric = {'Dimensions' => []} end |
#start_element(name, attrs = []) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/parsers/cloud_watch/list_metrics.rb', line 19 def start_element(name, attrs = []) super case name when 'Dimensions' @in_dimensions = true when 'member' if @in_dimensions reset_dimension end end end |