Class: Mccloud::Config::Definition
- Inherits:
-
Object
- Object
- Mccloud::Config::Definition
- Defined in:
- lib/mccloud/config/definition.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #define(name) {|definition_stub| ... } ⇒ Object
-
#initialize(config) ⇒ Definition
constructor
A new instance of Definition.
Constructor Details
#initialize(config) ⇒ Definition
Returns a new instance of Definition.
12 13 14 15 |
# File 'lib/mccloud/config/definition.rb', line 12 def initialize(config) @env=config.env @components=Hash.new end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
9 10 11 |
# File 'lib/mccloud/config/definition.rb', line 9 def components @components end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
10 11 12 |
# File 'lib/mccloud/config/definition.rb', line 10 def env @env end |
Instance Method Details
#define(name) {|definition_stub| ... } ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mccloud/config/definition.rb', line 17 def define(name) # We do this for vagrant syntax # Depending on type, we create a variable of that type # f.i. component_stub.vm or component_stub.lb definition_stub=OpenStruct.new definition_stub.definition=::Mccloud::Definition.new(name,env) env.logger.debug("config definitions"){ "Start reading definitions"} yield definition_stub env.logger.debug("config definitions"){ "End reading definition #{definition_stub.definition.name}"} components[name.to_s]=definition_stub.definition end |