Not ruby, but Javascript.
Have a look at underscore js source:
https://github.com/jashkenas/underscore/blob/master/undersco...
I really loved it! Especially those _ functions are small, concise and easy to understand as well. Very good codebase. (very good example of functional programming concepts)