Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ruby Hash Selector Pattern (codemy.net)
4 points by artellectual on March 16, 2014 | hide | past | favorite | 3 comments



At first glance, I was like "cool", let me check this out. Thinking about it a bit, I was wondering if this would ever pass a code review from my peers.

Probably not.

A Hash with values that are procs/lambdas? Seems like you are halfway to recognizing that you need an object.

But if you are having fun coding, that's all that matters, until you do a pull request with that in it ;)


Totally agree with not using this with procs/lambdas, but his first example seemed like a nice use case.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: