Class: Knife::Clc::ServerLaunch::ServerLauncher
- Inherits:
-
Object
- Object
- Knife::Clc::ServerLaunch::ServerLauncher
- Defined in:
- lib/knife-clc/server_launch/server_launcher.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(params) ⇒ ServerLauncher
constructor
A new instance of ServerLauncher.
- #launch_parameters ⇒ Object
- #prepare ⇒ Object
Constructor Details
#initialize(params) ⇒ ServerLauncher
Returns a new instance of ServerLauncher.
10 11 12 13 14 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 10 def initialize(params) @config = params.fetch(:config) @connection = params.fetch(:connection) @errors = params.fetch(:errors) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 8 def config @config end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
8 9 10 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 8 def connection @connection end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 8 def errors @errors end |
Instance Method Details
#execute ⇒ Object
16 17 18 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 16 def execute connection.create_server(launch_parameters) end |
#launch_parameters ⇒ Object
24 25 26 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 24 def launch_parameters @launch_parameters ||= mapper.prepare_launch_parameters end |
#prepare ⇒ Object
20 21 22 |
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 20 def prepare validator.validate end |