1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/parsers/redshift/cluster_security_group_parser.rb
Josh Lane d48d376e9c initial import
* take the liberty of correcting Aws naming
2014-12-31 09:17:51 -08:00

49 lines
1.4 KiB
Ruby

module Fog
module Parsers
module Redshift
module AWS
class ClusterSecurityGroupParser < Fog::Parsers::Base
# :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)
def reset
@cluster_security_group = fresh_cluster_security_group
end
def fresh_cluster_security_group
{'EC2SecurityGroups' => [], 'IPRanges' => []}
end
def start_element(name, attrs = [])
super
case name
when 'EC2SecurityGroups', 'IPRanges'
@list = {}
@list_name = name
end
end
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
end
end
end
end
end