# File lib/rudy/aws/ec2/group.rb, line 141 141: def list_as_hash(group_names=[], &each_group) 142: group_names = [group_names].flatten.compact 143: glist = @@ec2.describe_security_groups(:group_name => group_names) || {} 144: return unless glist['securityGroupInfo'].is_a?(Hash) 145: groups = {} 146: glist['securityGroupInfo']['item'].each do |oldg| 147: g = Groups.from_hash(oldg) 148: groups[g.name] = g 149: end 150: groups.each_value { |g| each_group.call(g) } if each_group 151: groups = nil if groups.empty? 152: groups 153: end