Sha256: aee9411223737c5f59b3774df392a190a792107ede25f9d0ac752af1395bc192
Contents?: true
Size: 860 Bytes
Versions: 33
Compression:
Stored size: 860 Bytes
Contents
require 'fog/collection' require 'fog/aws/models/ec2/security_group' module Fog module AWS module EC2 module Collections def security_groups Fog::AWS::EC2::SecurityGroups.new(:connection => self) end end class SecurityGroups < Fog::Collection attribute :group_name model Fog::AWS::EC2::SecurityGroup def initialize(attributes) @group_name ||= [] super end def all(group_name = @group_name) @group_name = group_name data = connection.describe_security_groups(group_name).body load(data['securityGroupInfo']) end def get(group_name) if group_name all(group_name).first end rescue Fog::Errors::NotFound nil end end end end end
Version data entries
33 entries across 33 versions & 2 rubygems