Skip to content

Instantly share code, notes, and snippets.

@lhz
Last active February 22, 2017 20:31
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 lhz/6d609aaae2c5cbfc8addc440cbd95ed3 to your computer and use it in GitHub Desktop.
Save lhz/6d609aaae2c5cbfc8addc440cbd95ed3 to your computer and use it in GitHub Desktop.
module Foo
module ClassMethods
def bar
"hi from .bar"
end
end
def baz
"hi from #baz"
end
end
class A
include Foo
extend Foo::ClassMethods
end
A.bar # => "hi from .bar"
a = A.new
a.baz # => "hi from #baz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment