-
Notifications
You must be signed in to change notification settings - Fork 35
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
OO-Ride-Share Pair Programming- Gessica Mohr & Anna Kim. #4
base: master
Are you sure you want to change the base?
Conversation
OO Ride ShareMajor Learning Goals/Code Review
Testing Requirements
Overall Feedback
Great work! Thorough testing, readable code, and it all works together! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
end | ||
|
||
def duration | ||
trip_duration = @end_time - @start_time |
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.
What if end_time is nil?
return total_revenue | ||
end | ||
|
||
def added_to_trip(trip) |
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 love that this is a method defined on Driver rather than putting this code directly into TripDispatcher :)
if rating.nil? | ||
@rating = rating | ||
elsif rating > 5 || rating < 1 | ||
raise ArgumentError.new("Invalid rating #{rating}") | ||
else @rating = rating | ||
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.
Love the validations! One way to refactor this code could be to make little helper methods for validating each parameter so that the constructor doesn't get cluttered.
Assignment Submission: OO Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection