Skip to content

Instantly share code, notes, and snippets.

@thisivan
Created June 10, 2009 06:19
Show Gist options
  • Save thisivan/127048 to your computer and use it in GitHub Desktop.
Save thisivan/127048 to your computer and use it in GitHub Desktop.
Sample Mixin
# = Mixin Template
# == Usage
# ActionController::Base.send :include, MixinModuleName
module MixinModuleName
def self.included(recipient)
recipient.extend(ClassMethods)
recipient.class_eval do
include InstanceMethods
end
end
module InstanceMethods
end
module ClassMethods
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment