My Cli GemProject : Nba teams

Steven Dessasore
3 min readApr 19, 2021

This was my second shot at attempting to complete the Cli Gem project for Phase1 and the API I decided to work with was from https://www.balldontlie.io/api/v1/teams . The reason why I decided to work with this API was because I am very familiar with the sport of basketball and the teams in the NBA. My first choice originally was the metropolitan Museum of Art but I found it too complex to work with so I decided to work with NBA teams.

The idea that I had for my project was for the application to give out a list of all 30 teams and to give us some basic information about those teams. I also wanted to go one level down in the application to add additional data for the user . The user will enter information such as their name, what team they wanted to select, answer if they wanted to view other teams information , and respond to if they wanted to exit the application.

The first thing I had to do to start my project was create a gem. This task was difficult and probably took me the longest to edit and complete due to me making changes from metropolitan museum of art to Nba teams. The gem install bundler in ubuntu help me create a list of files and directories to start my program.

gem install bundler

bundle gem nba_team_profile_cli

The name of my gem was nba_team_cli .

The three files that I mainly worked in were api.rb , cli.rb, and team.rb.

Api this is where we were taking the data from.

Cli is where we built different methods for our application such as user_ input, greet, goodbye, invalid, print, team details etc…

Team.rb is where objects are created and store . Also this is how the user will be able to view or retrieve the information.

The information I wanted the api to give us was basic information about the team. The information we wanted was abbreviation, conference, division, full name, and city. After the user puts in their name they would be able to see a list of the teams and their attributes.

The team I decided to work with today was the “New York Knicks” just due to the flatiron school being based out of NY.

If I were to put an invalid entry we would receive the following message “Hmmmm… that doesn't look right. Please try again”.

That pretty much completes the break down of my first project. I couldn’t be more proud of myself especially since the first time I wasn’t successful. I really tried my hardest at completing this and I hope the process gets easier down the road.

Some lessons I have learned about this project and myself

A few lessons I learned about the project would be to

  1. PLAN MORE
  2. Attend more open sessions with my instructor Candice.
  3. Talk more with my classmates.
  4. Don’t be afraid to get things wrongs
  5. Don’t quit.
  6. Work more with git commit -m, git add, git push through out the project.
  7. I should be taking notes as I am completing my project because it would have been easier to complete this blog post.

--

--