Skip to content

Laura Robertson -- Carets#30

Open
LauraAddams wants to merge 1 commit into
Ada-C8:masterfrom
LauraAddams:master
Open

Laura Robertson -- Carets#30
LauraAddams wants to merge 1 commit into
Ada-C8:masterfrom
LauraAddams:master

Conversation

@LauraAddams

Copy link
Copy Markdown

No description provided.

@LauraAddams LauraAddams changed the title Add files via upload Laura Robertson -- Carets Aug 14, 2017
Comment thread worksheet.rb

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
Copy Markdown
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
Copy Markdown
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