Class: Capistrano::ASG::Rolling::AutoscaleGroups
- Inherits:
-
Object
- Object
- Capistrano::ASG::Rolling::AutoscaleGroups
- Includes:
- Enumerable
- Defined in:
- lib/capistrano/asg/rolling/autoscale_groups.rb
Overview
Collection of Auto Scaling Groups.
Instance Method Summary collapse
- #<<(group) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(groups = []) ⇒ AutoscaleGroups
constructor
A new instance of AutoscaleGroups.
- #launch_templates ⇒ Object
- #with_launch_template(launch_template) ⇒ Object
Constructor Details
#initialize(groups = []) ⇒ AutoscaleGroups
Returns a new instance of AutoscaleGroups.
10 11 12 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 10 def initialize(groups = []) @groups = groups end |
Instance Method Details
#<<(group) ⇒ Object
14 15 16 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 14 def <<(group) @groups << group end |
#each(&block) ⇒ Object
18 19 20 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 18 def each(&block) @groups.reject { |group| filtered?(group) }.each(&block) end |
#launch_templates ⇒ Object
22 23 24 25 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 22 def launch_templates templates = @groups.map(&:launch_template) LaunchTemplates.new(templates) end |
#with_launch_template(launch_template) ⇒ Object
27 28 29 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 27 def with_launch_template(launch_template) self.class.new(select { |group| group.launch_template == launch_template }) end |