Class: BigBang::Run
- Inherits:
-
Object
- Object
- BigBang::Run
- Defined in:
- lib/bigbang/run.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#assigned_ips ⇒ Object
Returns the value of attribute assigned_ips.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#ec2_instances ⇒ Object
Returns the value of attribute ec2_instances.
-
#elastic_ip ⇒ Object
Returns the value of attribute elastic_ip.
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#wildcard_domain ⇒ Object
Returns the value of attribute wildcard_domain.
-
#zone_sizes ⇒ Object
Returns the value of attribute zone_sizes.
Instance Method Summary collapse
-
#initialize(name, instances) ⇒ Run
constructor
A new instance of Run.
- #instances_count ⇒ Object
- #zones ⇒ Object
Constructor Details
#initialize(name, instances) ⇒ Run
Returns a new instance of Run.
8 9 10 11 12 13 14 |
# File 'lib/bigbang/run.rb', line 8 def initialize(name, instances) @zone_sizes = {} @ec2_instances = [] @assigned_ips = {} @instance = instances.find { |i| i.name == name } raise "instance #{name} not found" if @instance.nil? end |
Instance Attribute Details
#assigned_ips ⇒ Object
Returns the value of attribute assigned_ips.
6 7 8 |
# File 'lib/bigbang/run.rb', line 6 def assigned_ips @assigned_ips end |
#domain ⇒ Object
Returns the value of attribute domain.
3 4 5 |
# File 'lib/bigbang/run.rb', line 3 def domain @domain end |
#ec2_instances ⇒ Object
Returns the value of attribute ec2_instances.
5 6 7 |
# File 'lib/bigbang/run.rb', line 5 def ec2_instances @ec2_instances end |
#elastic_ip ⇒ Object
Returns the value of attribute elastic_ip.
3 4 5 |
# File 'lib/bigbang/run.rb', line 3 def elastic_ip @elastic_ip end |
#instance ⇒ Object
Returns the value of attribute instance.
3 4 5 |
# File 'lib/bigbang/run.rb', line 3 def instance @instance end |
#wildcard_domain ⇒ Object
Returns the value of attribute wildcard_domain.
3 4 5 |
# File 'lib/bigbang/run.rb', line 3 def wildcard_domain @wildcard_domain end |
#zone_sizes ⇒ Object
Returns the value of attribute zone_sizes.
4 5 6 |
# File 'lib/bigbang/run.rb', line 4 def zone_sizes @zone_sizes end |
Instance Method Details
#instances_count ⇒ Object
22 23 24 |
# File 'lib/bigbang/run.rb', line 22 def instances_count zones.values.inject(0) { |m,v| m += v } end |
#zones ⇒ Object
16 17 18 19 20 |
# File 'lib/bigbang/run.rb', line 16 def zones return @zone_sizes unless @zone_sizes.empty? { nil => 1 } end |