Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created May 26, 2010 20:07
Show Gist options
  • Save jhsu/414975 to your computer and use it in GitHub Desktop.
Save jhsu/414975 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
class User
include RockNRole
has_rockin_roles
end
User.new.rock_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment