has_many
. In this presentation, Dave Thomas (PragDave) focuses on the Ruby features that make metaprogramming possible:- Class definitions are active - they get executed
This allows to execute custom code when a class gets first loaded. - All method calls have a receiver, i.e. a
self
object
A crucial fact in Ruby - Dave explains howself
some methods of metaprogramming work with manipulatingself
. - Classes are objects too
- Open and singleton classes - it's always possible to add members to classes
eval
flexibly with bindings and more.Check out "MetaProgramming Ruby".
Community comments
This is cool!!!
by Jure Srsen,
Re: This is cool!!!
by Dilya Han,
eph
by Andrei Zinca,
problems
by jimmy coyne,
Re: problems
by Sean Cribbs,
Re: problems
by johan andries,
able to download this?
by Hrafn Nordhri,
This is cool!!!
by Jure Srsen,
Your message is awaiting moderation. Thank you for participating in the discussion.
Tnx. It would be really nice if more Ruby presentations like this would be available.
eph
by Andrei Zinca,
Your message is awaiting moderation. Thank you for participating in the discussion.
An otherwise good presentation ruined by an awful, macabre joke.
problems
by jimmy coyne,
Your message is awaiting moderation. Thank you for participating in the discussion.
Is any body else having problems viewing this presentation?
Re: problems
by Sean Cribbs,
Your message is awaiting moderation. Thank you for participating in the discussion.
+1
Re: problems
by johan andries,
Your message is awaiting moderation. Thank you for participating in the discussion.
On Windows, for me it works in IE but not in FireFox.
able to download this?
by Hrafn Nordhri,
Your message is awaiting moderation. Thank you for participating in the discussion.
Are we able to download this?
Re: This is cool!!!
by Dilya Han,
Your message is awaiting moderation. Thank you for participating in the discussion.
You can watch Dave's other talk about Metaprogramming in ruby on YouTube here. YouTube also has many others talking about metaprogramming as well.
Also, there is a great Video Course about "Ruby Metaprogramming" here as well. Well worths its' price.
Disclaimer: I did peer review for the course. So, the author gave me $100 OFF coupon that I added to the URL above as well.