What do you use for modifying the class including a module?

rails

#1

There are several solutions that I know:

I am preferring the first one right now to avoid any “magic” & dependency on the huge “active_support” (while writing gems).
If I ever got the problem that: when A requiring B, it should also require C before B, I would have:

  • D wrapping B
  • D has class_eval to include C then B
  • A will require D instead of B
    I haven’t had time to read the source of the 3rd solution, saw it on RubyFlow or RubyWeekly.

What do you use? Do you have other solutions missing here?


#2

AS::Concern now, as I try to stick to the Rails way when using Rails.

Hadn’t heard of SuperModule… will check it out tho!