Class: AWS::EC2::SecurityGroup::IpPermissionCollection
- Inherits:
-
Object
- Object
- AWS::EC2::SecurityGroup::IpPermissionCollection
- Includes:
- Enumerable
- Defined in:
- lib/aws/ec2/security_group/ip_permission_collection.rb
Instance Attribute Summary collapse
-
#security_group ⇒ Object
readonly
Returns the value of attribute security_group.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(security_group, opts = {}) ⇒ IpPermissionCollection
constructor
A new instance of IpPermissionCollection.
Constructor Details
#initialize(security_group, opts = {}) ⇒ IpPermissionCollection
Returns a new instance of IpPermissionCollection.
27 28 29 30 |
# File 'lib/aws/ec2/security_group/ip_permission_collection.rb', line 27 def initialize(security_group, opts = {}) super @security_group = security_group end |
Instance Attribute Details
#security_group ⇒ Object (readonly)
Returns the value of attribute security_group.
25 26 27 |
# File 'lib/aws/ec2/security_group/ip_permission_collection.rb', line 25 def security_group @security_group end |
Instance Method Details
#each ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/aws/ec2/security_group/ip_permission_collection.rb', line 32 def each security_group..each do |p| groups = p.groups.collect do |group| SecurityGroup.new(group.group_id, :name => group.group_name, :owner_id => group.user_id, :config => config) end ip_ranges = p.ip_ranges.collect{|ip| ip.cidr_ip } = IpPermission.new(self, p.ip_protocol, [p.from_port, p.to_port], :ip_ranges => ip_ranges, :groups => groups, :config => config) yield() end end |