pws5068/Looper — pull request #1 by MikeSilvis (2013-03-20 03:58:08+00:00)
Title: attempting to refactor and make sense of looper

DO NOT MERGE THIS.

I have no clue what will happen as I never actually tested anything. Just trying to show off some of the things ruby can do.

NEVER use a `for` statement in ruby... And try as hard as you can to prevent a double nested loop...

http://ruby-doc.org/core-2.0/Enumerable.html

Enumerable is so powerful. Checkout things like: select, detect, map ( i saw you use collect which is the same thing), inject, etc.

This project from HA: http://tutorials.jumpstartlab.com/projects/sales_engine.html really helped me learn enumerable in ruby and all of the amazing things it can do.

here is my example: https://github.com/MikeSilvis/sales_engine

But I would REALLY try to do it on your own and TDD it. I learned so much from this project.