-
Notifications
You must be signed in to change notification settings - Fork 37
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
Ann's Ride Share Two project #18
base: master
Are you sure you want to change the base?
Conversation
…ive of each other
… methods for driver class.
…lasses. also relative specs.
it "raises an error when an invalid id is given" do | ||
proc { | ||
Rideshare::Driver.find(1000) | ||
}.must_raise ArgumentError |
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.
This is probably better to return nil
as opposed to an Error as it's not really an error, but rather nothing was found.
|
||
def self.all_drivers #method to return the class variable drivers | ||
return @drivers | ||
end |
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.
This seems to be accessing an instance variable, not a class variable....
Rideshare::Trips.all_trips.each do |trip| | ||
if trip.driver_id == @id #both are integers now, still not working | ||
driver_rating << trip.rating #rating must be integer | ||
end |
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.
You could create a method in Trips to return a list of Trips for a specific Driver ID.
Ride ShareWhat We're Looking For
SummaryOverall nicely done, you've come a long way and did a good job creating methods. Somethings to practice are using enumerable methods and making sure you test all the edge cases in your classes. |
Rideshare::Driver.all | ||
Rideshare::Trips.all | ||
Rideshare::Rider.all | ||
end |
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.
Do you need to do all three here?
Ride Share
Congratulations! You're submitting your assignment!
Comprehension Questions