lib/wmiirc/menu.rb
##
# Shows a key_menu() containing the given
# clients and returns the chosen client.
#
# If nothing was chosen, then nil is returned.
#
# ==== Parameters
#
# [prompt]
#   Instruction on what the user should enter or choose.
#
# [clients]
#   List of clients to present as choices to the user.
#
#   If this parameter is not specified,
#   its default value will be a list of
#   all currently available clients.
#
Shows a key_menu() containing the given
clients and returns the chosen client.

If nothing was chosen, then nil is returned.

Parameters

[prompt]
Instruction on what the user should enter or choose.

[clients]
List of clients to present as choices to the user.

If this parameter is not specified,
its default value will be a list of
all currently available clients.
Shows a key_menu () containing the given clients and returns the chosen client . If nothing was chosen then nil is returned . Parameters [ prompt ] Instruction on what the user should enter or choose . [ clients ] List of clients to present as choices to the user . If this parameter is not specified its default value will be a list of all currently available clients .
def client_menu prompt = nil, clients = Rumai.clients
    choices = clients.map do |c|
      "[#{c[:tags].read}] #{c[:label].read.downcase}"
    end
    if index = index_menu(choices, prompt)
      clients[index]
    end
  end
def client_menu prompt = nil , clients = Rumai . clients choices = clients . map do | c | "[#{c[:tags].read}] #{c[:label].read.downcase}" end if index = index_menu ( choices , prompt ) clients [ index ] end end
Shows a key_menu() containing the given
clients and returns the chosen client.
Shows a key_menu () containing the given clients and returns the chosen client .
prompt
<not_specific>
clients
<not_specific>