Building My First Project With Flatiron School!

Ashley Hernandez
3 min readDec 19, 2020

It’s been nearly 2 months since I’ve first joined Flatiron School’s Part-Time Online Software Engineering Bootcamp and I’ve already built my first CLI project. To say I didn’t struggle at all is a LIE, but I did enjoy every second of it. With that being said, I managed to build a project with the concepts that I learned and am now very proud of.

My project is called Gotta Catch Em All! which, in my terms, works like a mini-baby Pokedex for beginner Pokemon fans. My app displays basic information regarding the 1st generation of Pokemon — all 151 of them! You can view the weight, height, type, moves, abilities, and exp. of any Pokemon you choose to learn about more.

The basics.

To create my app I decided to use the Pokemon API. An API (or, Application Programming Interface) is a set of functions that allows two or more applications to “communicate” with each other. The Pokemon API is a nested API that unfortunately you need to make multiple calls with. The great thing though about the Pokemon API is that it does provide a lot of data to extract from.

The first thing I decided I wanted to display was obviously the names of the Pokemon. Heading over to the website: https://pokeapi.co/ I went over the documentation list provided and decided I would use the ‘standard’ API provided which was ‘https://pokeapi.co/api/v2/pokemon?limit=151'. This API allows users to pass in a query parameter ‘limit’, which allows users to limit the list being displayed to just 151. No more, no less.

“Pry” is awesome.

“Pry” is an alternative debugger to the IRB (Interactive Ruby Shell) that allows you to test your code and allow you to see where it may or may not be failing. “Pry” can be called in the middle of running a program — wherever in your code you’ve implemented ‘binding.pry’ is where your program will stop. Using “Pry” allowed me to see what format the response of my API request.

The information I needed was inside the “results” key. With the new knowledge thanks to “Pry”, I used the iterator each to access that data inside of it: data[“results”].each do |pokemon_hash|. Using an iterator allowed me to select the information I wanted.

Being able to use “Pry” helped so much in allowing to me test my code, make sure everything was working and ultimately allowed me to select the information I wanted to extract from the Pokemon API. “Pry” is a wonderful tool that every Ruby developer should take more advantage of.

--

--