Class: Crusher::Configurator::Configuration
- Inherits:
-
Object
- Object
- Crusher::Configurator::Configuration
- Defined in:
- lib/crusher/configurator.rb
Instance Attribute Summary collapse
-
#scenarios ⇒ Object
readonly
Returns the value of attribute scenarios.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
-
#initialize(config_path) ⇒ Configuration
constructor
A new instance of Configuration.
- #scenario(scenario_name, &block) ⇒ Object
- #target(target_name, &block) ⇒ Object
Constructor Details
#initialize(config_path) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/crusher/configurator.rb', line 8 def initialize(config_path) @targets = {} @scenarios = {} eval File.open(config_path).read end |
Instance Attribute Details
#scenarios ⇒ Object (readonly)
Returns the value of attribute scenarios.
6 7 8 |
# File 'lib/crusher/configurator.rb', line 6 def scenarios @scenarios end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
6 7 8 |
# File 'lib/crusher/configurator.rb', line 6 def targets @targets end |
Instance Method Details
#scenario(scenario_name, &block) ⇒ Object
18 19 20 |
# File 'lib/crusher/configurator.rb', line 18 def scenario scenario_name, &block @scenarios[scenario_name] = Crusher::Configurator::Scenario.new(&block) end |
#target(target_name, &block) ⇒ Object
14 15 16 |
# File 'lib/crusher/configurator.rb', line 14 def target target_name, &block @targets[target_name] = Crusher::Configurator::Target.new(&block) end |