Class: BigBang::DSL::Run
- Inherits:
-
Object
- Object
- BigBang::DSL::Run
- Defined in:
- lib/bigbang/dsl/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.
9 10 11 12 13 14 15 |
# File 'lib/bigbang/dsl/run.rb', line 9 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.
7 8 9 |
# File 'lib/bigbang/dsl/run.rb', line 7 def assigned_ips @assigned_ips end |
#domain ⇒ Object
Returns the value of attribute domain.
4 5 6 |
# File 'lib/bigbang/dsl/run.rb', line 4 def domain @domain end |
#ec2_instances ⇒ Object
Returns the value of attribute ec2_instances.
6 7 8 |
# File 'lib/bigbang/dsl/run.rb', line 6 def ec2_instances @ec2_instances end |
#elastic_ip ⇒ Object
Returns the value of attribute elastic_ip.
4 5 6 |
# File 'lib/bigbang/dsl/run.rb', line 4 def elastic_ip @elastic_ip end |
#instance ⇒ Object
Returns the value of attribute instance.
4 5 6 |
# File 'lib/bigbang/dsl/run.rb', line 4 def instance @instance end |
#wildcard_domain ⇒ Object
Returns the value of attribute wildcard_domain.
4 5 6 |
# File 'lib/bigbang/dsl/run.rb', line 4 def wildcard_domain @wildcard_domain end |
#zone_sizes ⇒ Object
Returns the value of attribute zone_sizes.
5 6 7 |
# File 'lib/bigbang/dsl/run.rb', line 5 def zone_sizes @zone_sizes end |
Instance Method Details
#instances_count ⇒ Object
23 24 25 |
# File 'lib/bigbang/dsl/run.rb', line 23 def instances_count zones.values.inject(0) { |m,v| m += v } end |
#zones ⇒ Object
17 18 19 20 21 |
# File 'lib/bigbang/dsl/run.rb', line 17 def zones return @zone_sizes unless @zone_sizes.empty? { nil => 1 } end |