Skip to content

Instantly share code, notes, and snippets.

@fakingfantastic
Created May 26, 2010 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fakingfantastic/414989 to your computer and use it in GitHub Desktop.
Save fakingfantastic/414989 to your computer and use it in GitHub Desktop.
module RockNRole
def self.included(base)
base.send :extend, ClassMethods
end
module ClassMethods
def has_rockin_roles
send :include, InstanceMethods
end
end
module InstanceMethods
def rock_out
puts "rock!"
end
end
end
# Hook into ActiveRecord.
ActiveRecord::Base.send :include, RockNRole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment