Skip to content

Queues - Cara Comfort - RideShare 2 - #35

Open
cecomfort wants to merge 36 commits into
Ada-C7:masterfrom
cecomfort:master
Open

Queues - Cara Comfort - RideShare 2#35
cecomfort wants to merge 36 commits into
Ada-C7:masterfrom
cecomfort:master

Conversation

@cecomfort

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? I had to decide what to do when the driver or rider find method did not find a driver or rider matching the id given. My two options were to either raise an argument error or to return nil. I decided on the later, since it didn't make sense for my program to stop running if a given driver or rider was not found.
Describe a concept that you gained more clarity on as you worked on this assignment. I gained clarity on whether a given method should be made a class method or an instance method.
Describe a nominal test that you wrote for this assignment. For the Driver.find method, I tested to see if it could find a given driver listed in the csv file. The driver instance's id just had to match the one provided as an argument.
Describe an edge case test that you wrote for this assignment. For the Driver.find method, I tested to make sure that it could find the last driver from the csv file. I did so by checking that it returned a driver object with an id matching the last listed driver id in the file.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? Planning out each class and their interaction with one another really helped wrap my mind around the behavior of each class and gave me a starting point to start writing code, instead of feeling overwhelmed.

@droberts-sea

Copy link
Copy Markdown

Ride Share

What We're Looking For

Feature Feedback
Baseline
Used Git Regularly yes - good work!
Answer comprehension questions yes
Driver
Uses the all method in the find method yes
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
Rider
Uses the all method in the find method yes
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 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 yes
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
Created a method to retrieve all trips by driver id yes
Created a method to retrieve all trips by rider id yes
Overall

Great job! Code is clear and readable, tests cover everything I was looking for, and git habits look solid. Keep up the good work!

Comment thread lib/driver.rb
self.all.find {|driver| driver.id == driver_id}
end

private

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good use of private to hide methods not part of your API.

Comment thread specs/driver_spec.rb
require_relative 'spec_helper'

describe "Driver" do
describe "constructor" do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good organization - the nested describes make this code much easier to read.

Comment thread specs/driver_spec.rb
end
end

it "returns an empty array if driver id is undefined" do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good test case! Edge cases like this, asking what happens when there isn't any data, can be easy to miss.

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