Skip to content

Create cassy_archibald_ride_share.rb#48

Open
cassyarchibald wants to merge 1 commit into
Ada-C10:masterfrom
cassyarchibald:master
Open

Create cassy_archibald_ride_share.rb#48
cassyarchibald wants to merge 1 commit into
Ada-C10:masterfrom
cassyarchibald:master

Conversation

@cassyarchibald

Copy link
Copy Markdown

ride share

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What did your data structure look like at first? Did this structure evolve over time? Why? At first it was within a hash with drivers as a key and an array of drivers as the value. I changed the format so the code wasn't nested in a hash as that seemed unnecessary. I also switched from having the driver id as the key with the driver information as values to having the driver id as a key/value pair within each drivers hash as I felt that made more sense.
What was your strategy for going through the data structure and gathering information? A combination of each loops, map methods, reduce, and max_by.
What was an example of something that was necessary to store in a variable? What was the scope of that variable? Why? I chose to store rides in an array of hashes as drivers can have multiple rides and rides had multiple key/value pairs.
What kinds of iteration did you use? Did you use .map? I did :), as well as each
Were some calculations easier than others? Why? I liked using max_by and reduce. It made my code much shorter than iterating through all the data.

@dHelmgren

Copy link
Copy Markdown

Great work on this! The structure is easy to parse for humans, and your use of enumerables is really solid!


# Step 4
drivers.each do |driver|
# CREATING SUM of driver's rating by adding all ratings for the driver

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I appreciate the clarity these comments lend!

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