Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created June 12, 2009 00:11
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/128337 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/128337 to your computer and use it in GitHub Desktop.
def self.included klass
klass.extend self.class.ancestors.inject(self.methods - [:included]) {|acc,a| acc - a.instance_methods }.inject(Module.new) {|mod,meth| mod.send :define_method, meth, &self.method(meth); mod }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment