Open vdolbilov opened 9 years ago
This is really well done -- especially with using regexes, group_by, and send. Nicely done!
In your generate_hash_from_shipment
method, it would be better served by using inject
to build your hash.
The output is extremely well done. NICE.
Hi Jesse,
I can't figure out a way to use inject nicely in that method. Inject adds up all the elements in the hash, which doesn't help me since I have to group them. So then, I'd have to use .group_by on the hash to group by appropriate values, then I can loop over each of the keys in this new hash and then run inject on the the arrays that would be the values.
This process seems more convoluted to me compared to my original method (3 loops with inject, 1 loop without).
On Fri, Jan 9, 2015 at 1:16 PM, Jesse Wolgamott notifications@github.com wrote:
This is really well done -- especially with using regexes, group_by, and send. Nicely done!
In your generate_hash_from_shipment method, it would be better served by using inject to build your hash.
The output is extremely well done. NICE.
— Reply to this email directly or view it on GitHub https://github.com/tiy-houston-q1-rails/week-1-lab/issues/1#issuecomment-69383570 .
https://gist.github.com/vdolbilov/ac1a5660de00430ae6a3