Class: Mccloud::Config::Keypair
- Inherits:
-
Object
- Object
- Mccloud::Config::Keypair
- Defined in:
- lib/mccloud/config/keypair.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) {|keypair_stub| ... } ⇒ Object
-
#initialize(config) ⇒ Keypair
constructor
A new instance of Keypair.
Constructor Details
#initialize(config) ⇒ Keypair
Returns a new instance of Keypair.
12 13 14 15 16 |
# File 'lib/mccloud/config/keypair.rb', line 12 def initialize(config) @env=config.env @components=Hash.new env.logger.debug("initalizing keypair") end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
9 10 11 |
# File 'lib/mccloud/config/keypair.rb', line 9 def components @components end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
10 11 12 |
# File 'lib/mccloud/config/keypair.rb', line 10 def env @env end |
Instance Method Details
#define(name) {|keypair_stub| ... } ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mccloud/config/keypair.rb', line 18 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 keypair_stub=OpenStruct.new keypair_stub.keypair=::Mccloud::Keypair.new(name,env) env.logger.debug("config keypair"){ "Start reading keypair"} yield keypair_stub env.logger.debug("config keypair"){ "End reading keypair #{keypair_stub.keypair.name}"} components[name.to_s]=keypair_stub.keypair end |