My First CLI Project
A month into Flatiron Bootcamp, and I have already learned tons of new skills in coding. My first CLI project involves a pizza menu; it allows users to select a pizza of their choice. Once a pizza has been selected, its description and price will be displayed to the user. The user then has the option to view the pizza menu again or exit the menu.
I started off my project by creating and choosing these attributes for my pizza menu: :name
, :description
, and :price
. Once I started working on scraping, this is where I had some difficulties grabbing the pizza name, description, and price because the way that the CSS elements were structured was bit complex, so I had to do a lot of testing to grab the elements I needed. Also, since the website contained an array of all the foods (not just pizza), I had to dig deep into the array to just grab the pizza menu.
Once I grabbed the elements I needed, I started the actual coding of making my CLI functional. The cli.rb
file is where I spent the majority of my time making my CLI work the way it was intended to. It allows users to type in their response, and once a response is typed, the pizza menu will be displayed, and the user can choose a pizza of his/her choice to see the price and its description.
Making this project allowed me to think logically at all times. As a beginner, I faced various challenges while making the CLI. I realized that the best way to actually learn to code is to make as many projects as possible because this is where we use our problem-solving abilities to make something work.
Feel free to checkout my Git Repo: https://github.com/pjfooeve09/pizza_menu