Skip to content

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