Skip to content

Lynn Trickey's Ride Share - #30

Open
ltrickey wants to merge 33 commits into
Ada-C7:masterfrom
ltrickey:master
Open

Lynn Trickey's Ride Share#30
ltrickey wants to merge 33 commits into
Ada-C7:masterfrom
ltrickey:master

Conversation

@ltrickey

Copy link
Copy Markdown

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? When creating the Rider.drivers method, I had to decide whether I wanted that method to speak directly to the Driver's class, or to operate through the Trip class by calling trip.driver. I initially only wanted my Rider and Driver class to communicate directly with trips, as it made sense to me that the Riders and Drivers should know less about each other's classes than Trip would. However, when I was writing the code, I initially wrote it so that the Rider.drivers method would call RideShare::Driver.find_driver on each driver ID returned by the Rider.trips method, because that's what made sense in my brain. After looking at this again, I figured out that I could instead call trip.driver, which then would call the RideShare::Driver.find_driver method, but from the Trip class instead of the Rider class. It still seems a little convoluted in my brain to do it this way, but I like that it sort of keeps the Rider and Driver classes separate, and only connects them through Trip.
Describe a concept that you gained more clarity on as you worked on this assignment. I was able to use a lot more enumerables in my code and in testing, particularly replacing each loops that would shovel into a new array with the find_all method. I see how enumerables can help a lot with DRYing up code.
Describe a nominal test that you wrote for this assignment. For Rider.drivers I wrote a test that would test that the method would return an Array and that the first and last element of that Array were class RideShare::Driver, essentially showing that the method is doing what it should be.
Describe an edge case test that you wrote for this assignment. After talking to some people in class, I decided to test that the list of drivers returned from Rider.drivers had no repeated drivers. So, with help, I found that rider 250 had multiple rides with the same Driver, and I wrote the test that checked that the list returned should be unique, using driver_ids.uniq!.must_be_nil
How do you feel you did in writing pseudocode first, then writing the tests and then the code? Love it. Love pseudocode, it's a game changer for me. I don't think I could have completed this assignment so quickly without it! Also testing first helps slow me down so I make sure I just do one thing at a time instead of trying to do too much and get lost in my code. Also the drawing out the classes helped me a lot. After I was done with my project I re-drew out my map to show how the messages sent between classes had changed, or turned out differently than I had first anticipated. It was cool!

ltrickey added 30 commits March 7, 2017 11:06
@kariabancroft

Copy link
Copy Markdown

Ride Share

What We're Looking For

Feature Feedback
Baseline
Used Git Regularly Yes
Answer comprehension questions Yes - the scenario you described was one that came up for folks, and I appreciate being able to follow how you reasoned through it
Driver
Uses the all method in the find method Yes. I'd argue that the find_driver method name is overkill since it is already written in the Driver class. I also think that returning nil for the driver is better than returning 0 because it's the absence of data as opposed to a specific value.
Has appropriate edge-case tests for each method in the class Yes
Created a method that uses a method from the Trip object to retrieve the list of trips Yes
Created a method that uses the internal trips list to calculate the average rating Yes - nice job
Rider
Uses the all method in the find method Yes
Has appropriate edge-case tests for each method in the class Yes - nice job using let to DRY things up
Created a method that uses a method from the Trip object to retrieve the list of trips Yes
Created a method that uses the internal trips method to retrieve the associated drivers Yes
Trip
Reads the CSV file in the all method Yes
Has appropriate edge-case tests for each method in the class Mostly - there is opportunity to explore some additional failure and edge cases in these tests
Created a method that uses a method from the Driver to retrieve the associated driver instance Yes
Created a method that uses a method from the Rider to retrieve the associated rider instance Yes - there are appropriately named
Created a method to retrieve all trips by driver id Yes
Created a method to retrieve all trips by rider id Yes - same argument as above about returning zero here. I think you want to return an empty array rather than a different data type altogether.
Overall Nice job - code is clear and clean

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.

2 participants