class ListWish

Public Instance Methods

aliases() click to toggle source
# File lib/zoom/wish/list_wish.rb, line 4
def aliases
    return ["la", "list", "ls"]
end
description() click to toggle source
# File lib/zoom/wish/list_wish.rb, line 8
def description
    return "List details for current/all profiles"
end
execute(args, djinni_env = {}) click to toggle source
# File lib/zoom/wish/list_wish.rb, line 12
def execute(args, djinni_env = {})
    if (!args.empty? && (args != "all"))
        usage
        return
    end

    config = djinni_env["config"]
    input = djinni_env["djinni_input"]
    input = "la" if (!args.empty?)

    case input
    when "la"
        profiles = config.parse_profiles
        profiles.keys.sort do |a, b|
            a.downcase <=> b.downcase
        end.each do |name|
            print_profile(profiles[name])
        end
    else
        profile = config.get_profile(
            config.get_current_profile_name
        )
        print_profile(profile)
    end
end
tab_complete(input, djinni_env = {}) click to toggle source
# File lib/zoom/wish/list_wish.rb, line 51
def tab_complete(input, djinni_env = {})
    return [{}, "", ""] if (input.include?(" "))
    return [{"all" => "List all profiles"}, input, ""]
end
usage() click to toggle source
# File lib/zoom/wish/list_wish.rb, line 56
def usage
    puts("#{aliases.join(", ")} [all]")
    puts("    #{description}.")
end

Private Instance Methods

print_profile(profile) click to toggle source