Class: Fog::Parsers::Compute::AWS::DescribeNetworkInterfaceAttribute

Inherits:
NetworkInterfaceParser show all
Defined in:
lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from NetworkInterfaceParser

#reset_nic

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



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
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb', line 34

def end_element(name)
  if @in_description
    case name
    when 'value'
      @response['description'] = value
    when 'description'
      @in_description = false
    end
  elsif @in_group_set
    case name
    when 'item'
      @response['groupSet'][@group['groupId']] = @group['groupName']
      @group = {}
    when 'groupId', 'groupName'
      @group[name] = value
    when 'groupSet'
      @in_group_set = false
    end
  elsif @in_source_dest_check
    case name
    when 'value'
      @response['sourceDestCheck'] = (value == 'true')
    when 'sourceDestCheck'
      @in_source_dest_check = false
    end
  elsif @in_attachment
    case name
    when 'attachmentId', 'instanceId', 'instanceOwnerId', 'deviceIndex', 'status', 'attachTime', 'deleteOnTermination'
      @attachment[name] = value
    when 'attachment'
      @response['attachment'] = @attachment
      @in_attachment          = false
    end
  else
    case name
    when 'requestId', 'networkInterfaceId'
      @response[name] = value
    end
  end
end

#resetObject



7
8
9
10
11
12
13
# File 'lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb', line 7

def reset
  @response             = { }
  @in_description       = false
  @in_group_set         = false
  @in_source_dest_check = false
  @in_attachment        = false
end

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



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/aws/parsers/compute/describe_network_interface_attribute.rb', line 15

def start_element(name, attrs = [])
  super
  case name
  when 'description'
    @in_description       = true
  when 'groupSet'
    @in_group_set         = true
    @group                = {}
    unless @response.key?('groupSet')
      @response['groupSet'] = {}
    end
  when 'sourceDestCheck'
    @in_source_dest_check = true
  when 'attachment'
    @in_attachment        = true
    @attachment           = {}
  end
end