-
Notifications
You must be signed in to change notification settings - Fork 45
Dikla Rikovich Grocery Store Octos #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Grocery StoreWhat We're Looking For
This is a good start. Your code for waves 1 and 2 is well-organized, accurate and easy to read, and I'm happy with your test cases for wave 2 as well. I am concerned that you did not make it to wave 3. Not getting to practice inheritance will make next week's project more difficult, and it also indicates that you're writing code slower than we would like. Being able to quickly and confidently solve problems is something that will grow with time and practice. One way to drill it is to take a small practice problem and build it starting from an empty file. The loop practice problems or something like flower or library is a good option. This is also something you can target with a tutor. This stuff isn't easy. I've seen you putting in the hours, and I really appreciate how hard you've been working. Keep up that dedication and keep your spirits high, and I know you'll get there. |
| products_hash[product_name] = product_price | ||
| end | ||
| order = Order.new(id, products_hash) | ||
| orders << order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work getting this complex bit of logic worked out!
| order_id = nil | ||
| self.all.each do |order| | ||
| if order.id == id | ||
| order_id = order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the name order_id describes what you're using this variable for. It looks like it's storing an order, not an ID. Something like matching_order might be a better choice.
|
|
||
|
|
||
| ap Grocery::Order.all | ||
| # puts " Product #{product[0]}: #{product[1]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove debugging print statements like this before submitting projects.
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError?.all&.findmethods class methods? Why not instance methods?Orderto get the list of all orders, which doesn't make much sense. With class methods, all you need is to know that there is such a thing as anOrder, and then you can callOrder.allto get the list.