Class: Capistrano::ASG::Rolling::AutoscaleGroups

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/capistrano/asg/rolling/autoscale_groups.rb

Overview

Collection of Auto Scaling Groups.

Instance Method Summary collapse

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

#eachObject



18
19
20
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 18

def each(&)
  @groups.reject { |group| filtered?(group) }.each(&)
end

#empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 22

def empty?
  none?
end

#launch_templatesObject



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

#rollingObject



26
27
28
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 26

def rolling
  self.class.new(select(&:rolling?))
end

#standardObject



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_imagesObject



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