DEV Community

gntorres
gntorres

Posted on

Top 50 Anime Gem

The gem I created helps users look at the top 50 anime from the past year. The system uses the run method to get things going as well as use my "get_data" method from my API class. api.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 8_41_41 PM (2)

The user is first greeted and then can continue on to be presented with the list if they wish to continue. The "anime_list" method I created first tells the user to select an anime and the is able to output the anime's title and index. cli.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 6_13_02 PM (2)

From there the user is able to input the index or title of the anime in order to gather more information. I had created a conditional statement that can take in the title, index, and also exit if the user wishes to cli.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 8_17_41 PM (2)

Depending on the input the user is then greeted with one of 3 methods cli.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 8_17_41 PM (3)

After selecting one of the conditional statements the user is then greeted with a second menu that allows them to continue searching and puts them into a loop. cli.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 8_17_53 PM (2)

Once the user is done searching he or she can exit the loop by typing in either "exit" or "n" depending on where they are in the loop.

When exiting the program the user is given a goodbye message saying "We hope to see you again". cli.rb - code [WSL_ Ubuntu] - Visual Studio Code 3_1_2021 8_17_53 PM (3)

Top comments (0)