Class: Fog::Parsers::Redshift::AWS::ClusterSubnetGroupParser

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.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



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb', line 33

def end_element(name)            
  super
  case name
  when 'ClusterSubnetGroupName', 'Desciption', 'VpcId', 'SubnetGroupStatus'
    @response[name] = value
  when 'SubnetIdentifier', 'SubnetStatus'
    @subnet[name] = value
  when 'Name'
    @subnet['SubnetAvailabilityZone'][name] = value
  when 'Subnet'
    @response['Subnets'] << {name => @subnet}
    @subnet = fresh_subnet
  end
end

#fresh_subnetObject



21
22
23
# File 'lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb', line 21

def fresh_subnet
  {'SubnetAvailabilityZone'=>{}}
end

#resetObject

:cluster_subnet_group_name - (String) :description - (String) :vpc_id - (String) :subnet_group_status - (String) :subnets - (Array)

:subnet_identifier - (String)
:subnet_availability_zone - (Hash)
  :name - (String)
:subnet_status - (String)


17
18
19
# File 'lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb', line 17

def reset
  @response = { 'Subnets' => [] }
end

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



25
26
27
28
29
30
31
# File 'lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb', line 25

def start_element(name, attrs = [])
  super
  case name
  when 'Subnets'
    @subnet = fresh_subnet
  end
end