views:

41

answers:

1

I wonder if there are Ruby snippets for various design patterns you can use in Ruby.

Examples:

  • Builder method
  • Declare ghost methods
  • Using blocks for DSLs (like Rails)

So that one doesn't have to reinvent the wheel.

Im not talking about books, but a collection of ruby snippets for various practical things, nothing abstract and general like the GOF patterns.

Snippets or examples that are useful for everyday coding in Ruby.

+2  A: 

AFAIK, there is the source code for Design Patterns in Ruby and the source code for Metaprogramming Ruby. Perhaps these snippets are not so useful or practical on their own, but they contain many design patterns, idioms, and "spells" in Ruby.

Of course, it would be great if someone could point us to a more practical set of ruby snippets, if such a set exists.

Yaser Sulaiman