Guest User

Untitled

a guest
May 26th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. module RockNRole
  2.  
  3. def self.included(base)
  4. base.send :extend, ClassMethods
  5. end
  6.  
  7. module ClassMethods
  8. def has_rockin_roles
  9. send :include, InstanceMethods
  10. end
  11. end
  12.  
  13. module InstanceMethods
  14. def rock_out
  15. puts "rock!"
  16. end
  17. end
  18.  
  19. end
  20.  
  21. # Hook into ActiveRecord.
  22. ActiveRecord::Base.send :include, RockNRole
Add Comment
Please, Sign In to add comment