RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

gem install eigenclass

Eigenclasses aka metaclasses or singleton classes in Ruby: https://github.com/shuber/eigenclass

Comments

Am I missing something? Why not using Object#singleton_class instead? Also, Object#singleton_class.instance_eval(&block) and Object#define_singleton_method.

I don’t see the point of this gem. Can you explain why would one add this gem?

This gem was originally written before those methods were introduced in Ruby 1.9. It also adds a bunch of convenience methods for defining accessors, aliases, and methods at the “eigenclass” level. It was recently updated to be used as a teaching tool for the newer Ruby developers on my team since it digs into the object model system a bit.

Teaching purposes. 👍

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in