Using a Rails initializer to create classes dynamically in Ruby

At the moment I’m working on a project where I want to dynamically create a set of classes in a RoR application.  This handy little snippet will create a class that extends a super class.


Thats pretty easy.

If you want it to happen automatically when you start your Rails app, create a .rb file in /config/initializers   …. Any code found in there will be run when the app starts up.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s