RubyFlow The Ruby and Rails community linklog

class_eval vs module_eval

Adding methods or attributes to a class/module “on-the-fly” is a pretty common pattern in Ruby (activerecord, activesupport, rake, rack, etc..).

To do so, we can use the Module#class_eval and Module#module_eval methods..
see more

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