Skip to content

Instantly share code, notes, and snippets.

@neerajsingh0101
Created September 4, 2008 17:52
Show Gist options
  • Save neerajsingh0101/8825 to your computer and use it in GitHub Desktop.
Save neerajsingh0101/8825 to your computer and use it in GitHub Desktop.
module Foo
def self.included(base)
base.class_eval do
extend ClassMethods
include InstanceMethods
end
end
module ClassMethods
def c
puts 'i am class method'
puts self
p = self.new
p.i
end
end
module InstanceMethods
def i
puts ' i am instance method'
end
end
end
class Person
include Foo
end
Person.c
# Person.new.i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment