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

Laura Robertson -- Carets #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

LauraAddams
Copy link

No description provided.

@LauraAddams LauraAddams changed the title Add files via upload Laura Robertson -- Carets Aug 14, 2017

value.each do |index|
# For each matching key, it adds the value to the selected array
index.each {|key2,value2| cost_array << value2 if key2 == :cost}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is kinda neat, but overly complicated.

You could instead do:

cost_array << value[:cost]

Be careful about overly complicating things.

@CheezItMan
Copy link
Collaborator

You organized the data well. I like how you created a hash with the Driver's ID as key and an array of trips (hashes) as the value.

I did put a note in your code where you loop through the structure, it's a bit overly complicated.

Overall very nicely done!

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