Class: BigBang::DSL
- Inherits:
-
Object
- Object
- BigBang::DSL
- Defined in:
- lib/bigbang/dsl.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 ⇒ DSL
constructor
A new instance of DSL.
- #instance(name, &block) ⇒ Object
- #run_cluster(name, &block) ⇒ Object
- #run_single_instance(name, &block) ⇒ Object
Constructor Details
#initialize ⇒ DSL
Returns a new instance of DSL.
10 11 12 13 |
# File 'lib/bigbang/dsl.rb', line 10 def initialize @instances = [] @runs = [] end |
Instance Attribute Details
#conf ⇒ Object
Returns the value of attribute conf.
8 9 10 |
# File 'lib/bigbang/dsl.rb', line 8 def conf @conf end |
#instances ⇒ Object
Returns the value of attribute instances.
8 9 10 |
# File 'lib/bigbang/dsl.rb', line 8 def instances @instances end |
#runs ⇒ Object
Returns the value of attribute runs.
8 9 10 |
# File 'lib/bigbang/dsl.rb', line 8 def runs @runs end |
Instance Method Details
#config(&block) ⇒ Object
21 22 23 24 25 |
# File 'lib/bigbang/dsl.rb', line 21 def config(&block) @conf = Config.new.tap do |c| c.instance_eval(&block) end end |
#instance(name, &block) ⇒ Object
15 16 17 18 19 |
# File 'lib/bigbang/dsl.rb', line 15 def instance(name, &block) @instances << Instance.new(name).tap do |i| i.instance_eval(&block) end end |
#run_cluster(name, &block) ⇒ Object
33 34 35 36 37 |
# File 'lib/bigbang/dsl.rb', line 33 def run_cluster(name, &block) @runs << ClusterRun.new(name, @instances).tap do |r| r.instance_eval(&block) end end |