Class: Nvoi::Cli::Onboard::Steps::Compute
- Inherits:
-
Object
- Object
- Nvoi::Cli::Onboard::Steps::Compute
- Includes:
- Ui
- Defined in:
- lib/nvoi/cli/onboard/steps/compute.rb
Overview
Collects compute provider configuration
Constant Summary collapse
- PROVIDERS =
[ { name: "Hetzner (recommended)", value: :hetzner }, { name: "AWS", value: :aws }, { name: "Scaleway", value: :scaleway } ].freeze
Constants included from Ui
Instance Method Summary collapse
- #call(existing: nil) ⇒ Object
-
#initialize(prompt, test_mode: false) ⇒ Compute
constructor
A new instance of Compute.
Methods included from Ui
#box, #error, #output, #prompt_with_retry, #section, #success, #table, #with_spinner
Constructor Details
#initialize(prompt, test_mode: false) ⇒ Compute
Returns a new instance of Compute.
17 18 19 20 |
# File 'lib/nvoi/cli/onboard/steps/compute.rb', line 17 def initialize(prompt, test_mode: false) @prompt = prompt @test_mode = test_mode end |
Instance Method Details
#call(existing: nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nvoi/cli/onboard/steps/compute.rb', line 22 def call(existing: nil) section "Compute Provider" provider = @prompt.select("Select provider:", PROVIDERS) case provider when :hetzner then setup_hetzner when :aws then setup_aws when :scaleway then setup_scaleway end end |