Class: Fog::Parsers::Redshift::AWS::ClusterSecurityGroupParser

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



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

def end_element(name)       
  super     
  case name
  when 'ClusterSecurityGroupName', 'Description'
    @cluster_security_group[name] = value
  when 'EC2SecurityGroupName', 'EC2SecurityGroupOwnerId', 'CIDRIP', 'Status'
    @list[name] = value
  when 'EC2SecurityGroup', 'IPRange'
    @cluster_security_group[@list_name] << {name => @list}
    @list = {}
  end
end

#fresh_cluster_security_groupObject



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

def fresh_cluster_security_group
  {'EC2SecurityGroups' => [], 'IPRanges' => []}
end

#resetObject

:cluster_security_group_name - (String)

:description - (String)
:ec_2_security_groups - (Array)
  :status - (String)
  :ec2_security_group_name - (String)
  :ec2_security_group_owner_id - (String)
:ip_ranges - (Array)
  :status - (String)
  :cidrip - (String)


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

def reset
  @cluster_security_group = fresh_cluster_security_group
end

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



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

def start_element(name, attrs = [])
  super
  case name
  when 'EC2SecurityGroups', 'IPRanges'
    @list = {}
    @list_name = name
  end
end