Class: Knife::Clc::ServerLaunch::ServerLauncher

Inherits:
Object
  • Object
show all
Defined in:
lib/knife-clc/server_launch/server_launcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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

#connectionObject (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

#errorsObject (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

#executeObject



16
17
18
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 16

def execute
  connection.create_server(launch_parameters)
end

#launch_parametersObject



24
25
26
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 24

def launch_parameters
  @launch_parameters ||= mapper.prepare_launch_parameters
end

#prepareObject



20
21
22
# File 'lib/knife-clc/server_launch/server_launcher.rb', line 20

def prepare
  validator.validate
end