Skip to content

Instantly share code, notes, and snippets.

@lian
Created November 6, 2013 23:50
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 lian/7346379 to your computer and use it in GitHub Desktop.
Save lian/7346379 to your computer and use it in GitHub Desktop.
module B
def self.included(base)
base.extend(ClassMethods)
end
def foo
p 'from instance'
end
module ClassMethods
def bar
p 'from class'
end
end
end
class A
include B
end
A.new.foo
A.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment