JesseNReynolds

Posted on

# My first project

When I signed up for Flatiron School, I started keeping a little idea log for apps to build. I opened that idea log up when it was time to plan my first project, and I grabbed one I thought would be fun and could be factored well into the project requirements. What I found surprising was how quickly my minimum viable product came together! Sure, it didn't check off all the boxes I wanted to, but it did what the app wants to do at it's heart.

From there it was a matter of adding features, refactoring things that are not best practices, improving the interface, streamlining the logic, etc.

What seemed a few weeks ago like it would be a big job seems easy now, at least in recollection. Of course there were moments of frustration; there were things that made me confused, things that I just could not get working for the longest time, but every time I checked something off my features wish-list, I got a nice hit of dopamine that made the whole process very enjoyable.

It's not perfect, it's not finished but it works, and I built it.

I learned some stuff, like using a while loop to control for answers to prompts that aren't understandable or would create problems down the line, instead of using recursion.

``````def filter_price
complete = false

while complete == false
puts "Do you want to filter by price? (y/n)"
puts "Restaurants are given price ranges from 1 to 4, where 4 is the highest."

puts "Please enter a minimum price range from 1 to 4 (decimals NOT OK!)"
min_price = gets.chomp.to_i

puts "Please enter a maximum price range from 1 to 4(decimals NOT OK!)"
max_price = gets.chomp.to_i

complete = true

if min_price > max_price
puts "Please enter a maximum price range that is higher than or equal to your minimum price range."
complete = false
end

min_price = 1
max_price = 4
complete = true
else
puts "Sorry, I don't understand, please respond with y or n"
end
end
``````

I got more practice writing methods from scratch, passing data around, creating objects with that data, and iterating over the objects to actually do stuff with the data inside.

The jump from the JSON data that Yelp returned to properly instantiated data attached to objects created a fun challenge that I was able to solve with meta-programming to help improve scalability and compatibility in the future.

``````
def self.new_from_json(parsed_data)
new_restaurant = Restaurants.new