Class: BigBang::DSL::Universe
- Inherits:
-
Object
- Object
- BigBang::DSL::Universe
- Defined in:
- lib/bigbang/dsl/universe.rb
Instance Attribute Summary collapse
-
#conf ⇒ Object
Returns the value of attribute conf.
-
#instances ⇒ Object
Returns the value of attribute instances.
-
#runs ⇒ Object
Returns the value of attribute runs.
Instance Method Summary collapse
- #config(&block) ⇒ Object
-
#initialize(&block) ⇒ Universe
constructor
A new instance of Universe.
- #instance(name, &block) ⇒ Object
- #run_cluster(name, &block) ⇒ Object
- #run_single_instance(name, &block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Universe
Returns a new instance of Universe.
6 7 8 9 10 |
# File 'lib/bigbang/dsl/universe.rb', line 6 def initialize(&block) @instances = [] @runs = [] self.instance_eval(&block) end |
Instance Attribute Details
#conf ⇒ Object
Returns the value of attribute conf.
4 5 6 |
# File 'lib/bigbang/dsl/universe.rb', line 4 def conf @conf end |
#instances ⇒ Object
Returns the value of attribute instances.
4 5 6 |
# File 'lib/bigbang/dsl/universe.rb', line 4 def instances @instances end |
#runs ⇒ Object
Returns the value of attribute runs.
4 5 6 |
# File 'lib/bigbang/dsl/universe.rb', line 4 def runs @runs end |
Instance Method Details
#config(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/bigbang/dsl/universe.rb', line 18 def config(&block) @conf = Config.new.tap do |c| c.instance_eval(&block) end end |
#instance(name, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/bigbang/dsl/universe.rb', line 12 def instance(name, &block) @instances << Instance.new(name).tap do |i| i.instance_eval(&block) end end |
#run_cluster(name, &block) ⇒ Object
30 31 32 33 34 |
# File 'lib/bigbang/dsl/universe.rb', line 30 def run_cluster(name, &block) @runs << ClusterRun.new(name, @instances).tap do |r| r.instance_eval(&block) end end |