Skip to content
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

Aurea & Anibel - Edges #1

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Aurea & Anibel - Edges #1

wants to merge 34 commits into from

Conversation

Aurea-Li
Copy link

OO Ride Share

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? For duration in the Trip class, we decided that for any in-progress trips, it would evaluate to nil as opposed to 0. We used nil as an indication of in-progress trips in our other method total_time_spent.
Describe any examples of composition that you encountered in this project, if any Each User has a one to many relationship to Trip, and each Trip has a one to one relationship with a Driver, and a one to one or one to many relationship with User as a passenger.
Describe the relationship between User and Driver Driver inherits User attributes and behaviors. It is a direct child of the User class.
Describe a nominal test that you wrote for this assignment. In trip_dispatcher_spec.rb, in the assign_driver method tests starting on line 177, we wrote tests that checked to make sure that it returns the driver with the oldest most recent trip.
Describe an edge case test that you wrote for this assignment In trip_dispatcher_spec.rb, the test starting in line 136, we check to see that request_trip returns nil if no available drivers.
Describe a concept that you/your pair gained more clarity on as you worked on this assignment When we worked on wave 2 and updating/writing the load methods for the three classes, it became apparent to think about the order in which we loaded csv files since the classes interacted with each other.
What are two discussion points that you and your pair discussed when giving/receiving feedback from each other that you would be willing to share? One thing we struggled with was how to pair successfully when we are trying to debug nested and/or embedded objects/data structures. It was also mentioned that debugging could be daunting in front of an audience. We could also work on letting the driver try to solve a coding problem first before the navigator directs them.

anibelamerica and others added 30 commits August 27, 2018 15:07
@tildeee
Copy link

tildeee commented Sep 4, 2018

Ride Share

What We're Looking For

Feature Feedback
Baseline
Used Git Regularly x
Answer comprehension questions x
Wave 1
Appropriate use of Ruby's Date x
Trip has a helper method to calculate duration x
User has a method to calculate total cost of all trips x
Tests for wave 1 x
Wave 2
Driver inherits from User x
Driver has add_driven_trip method x
Driver has method to calculate average rating x
Driver has method to calculate net expenditures and it uses super x
Driver has a method to calculate total revenue x
Tests for wave 2 x
Wave 3
TripDispatcher has a new method to create trips x
creating a trip in TripDispatcher relies on methods in Driver and User (passenger) to modify their own attributes
Complex logic was correctly implemented x
Tests for request_trip x, well done!
Methods from wave 1 and 2 handle incomplete trips x
Tests for wave 1 and 2 methods with incomplete trips x
Wave 4 (Optional)
TripDispatcher now assigns trips to either the newest driver (no trips), or the driver who has not driven in the longest time x
Appropriate helper methods were made to help with complex logic x
Tests for wave 4 x
Overall

Great work on this project you too!

Your code is really clear and readable-- in the bits with complex logic, the code ends up being very clear because of the appropriate use of Enumerable short hand methods, and otherwise in general everything else was kept tidy and organized.

The ternaries really paid off in this code base-- everything looks great

You made all of your instance variables in every class read-only, and that makes me really happy!

Adding a few comments for suggestions, but otherwise good job

def total_revenue
valid_trips = @driven_trips.find_all { |trip| trip.cost }

return (valid_trips.sum { |trip| trip.cost - 1.65} * 0.80).round(2)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably pull these "magic number" integers out into constants

@passengers = load_users(user_file)
@drivers = load_drivers(driver_file)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done loading drivers before trips!


it 'selects a driver with an available status' do
driver = @dispatcher.find_driver(8)
num_of_trips = driver.driven_trips.length
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/pasta! num_of_trips doesn't get used in this test


driver_5.add_driven_trip(trip3)

expect( @dispatcher.assign_driver.id ).must_equal 8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with these tests and making the test data yours so you can use concrete answers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants