module SltcProviderPrompter def sltc_provider_id(allow_none=false) return options[:slt_provider_id] = prompt_for_sltc_provider_id(allow_none) end private def prompt_for_sltc_provider_id(allow_none) result = get("services/sltc_providers?configured_account_id=#{configured_account_id}") (puts "No providers are configured. Cannot continue"; exit 1) if result.empty? # Build a menu of the providers puts return prompter.choose do | menu | menu.prompt = "Select the Provider: " menu.choice("No Selection") { -1 } if allow_none result.each do | provider | menu.choice(provider['name']) { provider['id'] } end end end end