What's New in Edge Rails: Get Your Metaclass 3

Posted by ryan
at 7:48 PM on Saturday, July 19, 2008



The ActiveSupport library now has a little nugget worth mentioning – a metaclass accessor available everywhere as metaclass.

Not sure what a metaclass (or singleton class, or eigen class) is? Let Ola explain it to you.

tags: ruby, rubyonrails

Comments

Leave a response

  1. Richard PoirierJuly 20, 2008 @ 04:50 PM

    Dave Thomas also does a great job of explaining the metaclass in his screencasts: http://www.pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming

  2. Mary FiorattiJuly 21, 2008 @ 05:23 AM

    Thanks for the link Richard Dave does a great job at explaining it, he is spot on!

  3. jblancheJuly 21, 2008 @ 06:23 PM

    Hi,

    I’m sorry to talk of another article in this one but the comments are closed in the other one.

    I just wan’t to say that in the article about activeResource custom methods the last example is either wrong or outdated.

    In fact the good “find” method should be

    Person.find(:all, :from => :managers)

    There is not a lot of resources about ActiveResource out there so that an outdated example means lot of pain for a beginner, so I think it would be great to update this one.

    PS : Feel free to move or delete this comment ;)

Comment