Class: Fog::Parsers::Compute::AWS::DescribeAvailabilityZones

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

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/aws/parsers/compute/describe_availability_zones.rb', line 20

def end_element(name)
  case name
  when 'item'
    unless @in_message_set
      @response['availabilityZoneInfo'] << @availability_zone
      @availability_zone = { 'messageSet' => [] }
    end
  when 'message'
    @availability_zone['messageSet'] << value
  when 'regionName', 'zoneName', 'zoneState'
    @availability_zone[name] = value
  when 'requestId'
    @response[name] = value
  when 'messageSet'
    @in_message_set = false
  end
end

#resetObject



15
16
17
18
# File 'lib/fog/aws/parsers/compute/describe_availability_zones.rb', line 15

def reset
  @availability_zone = { 'messageSet' => [] }
  @response = { 'availabilityZoneInfo' => [] }
end

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



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

def start_element(name, attrs = [])
  case name
  when 'messageSet'
    @in_message_set = true
  end
  super
end