Class: Veewee::Config::Definition
- Inherits:
-
Object
- Object
- Veewee::Config::Definition
- Defined in:
- lib/veewee/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
Currently not used, this is in case we will specify the a definition in the Veeweefile This is for future needs.
-
#initialize(config) ⇒ Definition
constructor
A new instance of Definition.
Constructor Details
#initialize(config) ⇒ Definition
Returns a new instance of Definition.
13 14 15 16 |
# File 'lib/veewee/config/definition.rb', line 13 def initialize(config) @env=config.env @components=Hash.new end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
10 11 12 |
# File 'lib/veewee/config/definition.rb', line 10 def components @components end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
11 12 13 |
# File 'lib/veewee/config/definition.rb', line 11 def env @env end |
Instance Method Details
#define(name) {|definition_stub| ... } ⇒ Object
Currently not used, this is in case we will specify the a definition in the Veeweefile This is for future needs
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/veewee/config/definition.rb', line 20 def define(name) # Depending on type, we create a variable of that type definition_stub=OpenStruct.new begin # Get a real definition object real_definition=::Veewee::Definition.new(name,env) rescue Error => e env.ui.error("Error loading provider with #{name},#{$!}",:prefix => false) end definition_stub.definition=real_definition env.logger.debug("config definition"){ "Start defining definition"} yield definition_stub env.logger.debug("config definition"){ "End defining definition #{definition_stub.definition.name}"} components[name.to_s]=definition_stub.definition end |