class TypeMenu

Attributes

cli[RW]

Public Class Methods

new(cli) click to toggle source
# File lib/dexter_plusplus/type_menu.rb, line 5
def initialize(cli)
    self.cli = cli
end

Public Instance Methods

display_more_options(type) click to toggle source
# File lib/dexter_plusplus/type_menu.rb, line 30
def display_more_options(type)
    puts "\n\n"
    input = self.cli.prompt.select("What information about #{type.name.capitalize} do you want to see?", cycle: true) do |menu|
        menu.choice 'See Pokemon of this type', 1
        menu.choice 'See Moves of this type', 2
        menu.choice 'Return to main menu'.light_green, 3
        menu.choice 'Exit Dexter++'.light_red, 4
    end

    case input
    when 1
        menu = PokemonMenu.new(self.cli)
        menu.search_by_type(type)
    when 2
        menu = MoveMenu.new(self.cli)
        menu.search_by_type(type)
    when 3
        self.cli.main_menu
    when 4
        self.cli.exit_program
    end

end
main_menu() click to toggle source