Class: Fog::Parsers::AWS::ELBV2::DescribeTags

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

Instance Method Summary collapse

Instance Method Details

#end_element(name) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fog/aws/parsers/elbv2/describe_tags.rb', line 27

def end_element(name)
  super
  case name
    when 'member'
      if @in_tags
        @tags[@this_key] = @this_value
        @this_key, @this_value = nil, nil
      else
        @response['DescribeTagsResult']['TagDescriptions'] << { 'Tags' => @tags, 'ResourceArn' => @resource_arn }
      end
    when 'Key'
      @this_key = value
    when 'Value'
      @this_value = value
    when 'ResourceArn'
      @resource_arn = value
    when 'RequestId'
      @response['ResponseMetadata'][name] = value
    when 'Tags'
      @in_tags = false
  end
end

#resetObject



6
7
8
9
10
11
12
# File 'lib/fog/aws/parsers/elbv2/describe_tags.rb', line 6

def reset
  @this_key   = nil
  @this_value = nil
  @tags       = Hash.new
  @response   = { 'DescribeTagsResult' => { 'TagDescriptions' => [] }, 'ResponseMetadata' => {} }
  @in_tags = false
end

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



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fog/aws/parsers/elbv2/describe_tags.rb', line 14

def start_element(name, attrs = [])
  super
  case name
    when 'member'
      unless @in_tags
        @resource_arn = nil
        @tags = {}
      end
    when 'Tags'
      @in_tags = true
  end
end