Class: Pvectl::Wizards::CreateVm
- Inherits:
-
Object
- Object
- Pvectl::Wizards::CreateVm
- Defined in:
- lib/pvectl/wizards/create_vm.rb
Overview
Interactive wizard for creating a VM step by step.
Uses TTY::Prompt (when available) or a fallback prompt to guide the user through VM configuration. Returns a normalized params hash compatible with Services::CreateVm, or nil if the user cancels.
Constant Summary collapse
- OS_TYPES =
%w[l26 l24 win11 win10 win2k22 win2k19 win2k16 win8 win7 other].freeze
Instance Method Summary collapse
-
#initialize(options, global_options, prompt: nil) ⇒ CreateVm
constructor
Creates a new CreateVm wizard.
-
#run ⇒ Hash?
Runs the wizard and returns params or nil if cancelled.
Constructor Details
#initialize(options, global_options, prompt: nil) ⇒ CreateVm
Creates a new CreateVm wizard.
24 25 26 27 28 |
# File 'lib/pvectl/wizards/create_vm.rb', line 24 def initialize(, , prompt: nil) @options = @global_options = @prompt = prompt || create_default_prompt end |
Instance Method Details
#run ⇒ Hash?
Runs the wizard and returns params or nil if cancelled.
33 34 35 |
# File 'lib/pvectl/wizards/create_vm.rb', line 33 def run collect_params end |