module Zapnito::Cli::Questions

Public Instance Methods

which_slug?(api_token, basepath) click to toggle source
# File lib/zapnito/cli/questions.rb, line 6
def which_slug?(api_token, basepath)
  puts
  HighLine.new.choose do |menu|
    menu.prompt = "Which tenant do you want to add? "
    available_slugs(api_token, basepath).each do |tenant_slug|
      menu.choice(tenant_slug) { tenant_slug }
    end
  end
end

Private Instance Methods

available_slugs(api_token, basepath) click to toggle source
# File lib/zapnito/cli/questions.rb, line 18
def available_slugs(api_token, basepath)
  tenant_slugs = Services.zapnito(api_token, basepath).tenant_slugs
  existing_slugs = Services.local.tenant_slugs
  tenant_slugs - existing_slugs
end