Grocery Store Project#37
Open
amanzan1 wants to merge 4 commits into
Open
Conversation
Grocery StoreWhat We're Looking For
|
CheezItMan
reviewed
Feb 22, 2018
| @@ -0,0 +1,2 @@ | |||
| name = ARGV.first || "World" | |||
There was a problem hiding this comment.
This file should not be in your submission.
| class OnlineOrder < Order | ||
| attr_reader :customer_id, :status | ||
|
|
||
| def initialize (id, products, customer_id, status) |
| return 10 + super | ||
| end | ||
|
|
||
| def self.find(id) |
There was a problem hiding this comment.
Since self.find really doesn't change between this class and the superclass Order you could just not override the find method and use Order's version.
|
|
||
| def self.find(id) | ||
| online_orders = OnlineOrder.all | ||
| online_orders.each do |o| |
| return nil | ||
| end | ||
|
|
||
| def self.all |
|
|
||
|
|
||
| def self.all | ||
| require 'csv' |
There was a problem hiding this comment.
The require 'csv' should go at the top of the file.
| # csv = CSV.open("../support/online_orders.csv")r | ||
| csv = CSV.open("support/orders.csv") | ||
| orders = [] | ||
| csv.each do |l| |
| #puts l[1].split(';') | ||
|
|
||
| product_string = l[1] | ||
| product_smash = product_string.split(';') |
|
|
||
| def self.find(id) | ||
| orders = Order.all | ||
| orders.each do |o| |
| @@ -0,0 +1,4 @@ | |||
| class EBook < Book | |||
There was a problem hiding this comment.
This should not be in your submission.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError?.all&.findmethods class methods? Why not instance methods?