views:

1258

answers:

5

I have just started to learn Ruby and got a good take on the basics. I keep hearing that one of the cool things that Ruby does very well is metaprogramming, but none of the tutorials I've read cover this. Searching Google I can only seem to find paid for ruby metaprogramming screen casts.

So, where can I find a good Ruby metaprogramming tutorial online?

+1  A: 

Here is a nice overview: http://ola-bini.blogspot.com/2006/09/ruby-metaprogramming-techniques.html

flicken
+2  A: 

Here is a good introduction for ruby metaprogramming: http://practicalruby.blogspot.com/2007/02/ruby-metaprogramming-introduction.html

ecleel
+7  A: 

The above article does refer to this but I'll post it for clarity: http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html

The Dwemthy's Array sample linked from there is a great (if not entirely practical) example of metaprogramming.
Chuck
This link seems to be broken :(
Kev
This can now be found here: http://dannytatom.github.com/metaid/Amazing.
nilbus
+2  A: 

If you are prepared to outlay a little cash, then The Pragmatic Programmers website has an excellent screencast series on the Ruby Object Model and metaprogramming. It's not very expensive and is a very comprehensive series that goes over a lot of cool stuff and worth every cent.

I need to watch it again to try and get my head around some of the concepts, then I can be one of the cool meta crowd :)

railsninja
A: 

It's easy to do meta programming in Ruby. Here is a 16-posts series on meta programming in Ruby.

http://learnbysoft.blogspot.com/2010/10/meta-programming-in-ruby-part-1-alias.html

Can Python or Lisp match Ruby's ease?

ruby @ LearnBySoft

Ruby Tutor