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 ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(groups = []) ⇒ AutoscaleGroups
constructor
A new instance of AutoscaleGroups.
- #launch_templates ⇒ Object
- #rolling ⇒ Object
- #standard ⇒ Object
- #with_launch_template(launch_template) ⇒ Object
- #with_unique_images ⇒ 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 ⇒ Object
18 19 20 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 18 def each(&) @groups.reject { |group| filtered?(group) }.each(&) end |
#empty? ⇒ Boolean
22 23 24 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 22 def empty? none? end |
#launch_templates ⇒ Object
38 39 40 41 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 38 def launch_templates templates = map(&:launch_template) LaunchTemplates.new(templates) end |
#rolling ⇒ Object
26 27 28 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 26 def rolling self.class.new(select(&:rolling?)) end |
#standard ⇒ Object
30 31 32 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 30 def standard self.class.new(reject(&:rolling?)) end |
#with_launch_template(launch_template) ⇒ Object
43 44 45 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 43 def with_launch_template(launch_template) self.class.new(select { |group| group.launch_template == launch_template }) end |
#with_unique_images ⇒ Object
34 35 36 |
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 34 def with_unique_images self.class.new(uniq { |group| group.launch_template.image_id }) end |