Advertisement
Guest User

Untitled

a guest
Dec 28th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Logger
  2.   module ClassMethods
  3.     def classmethod1
  4.       :foo
  5.     end
  6.    
  7.     def classmethod2
  8.       :bar
  9.     end
  10.   end
  11.  
  12.   def instancemethod1
  13.     :baz
  14.   end
  15.  
  16.   def instancemethod2
  17.     :qux
  18.   end
  19.  
  20.   def self.included(base)
  21.     base.extend(ClassMethods)
  22.   end
  23. end
  24.  
  25.  
  26.  
  27. #how can i also use the module LoggerClassMethods to create instance methods instead of class methods with the self.included(base) hook?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement