Skip to content

Instantly share code, notes, and snippets.

@hannestyden
Created April 13, 2010 09:30
Show Gist options
  • Save hannestyden/364459 to your computer and use it in GitHub Desktop.
Save hannestyden/364459 to your computer and use it in GitHub Desktop.
module M
extend self
def m
:m
end
end
class A
extend M
end
class B
include M
end
M.m # => :m
A.new.m rescue :undefined_method # => :undefined_method
A.m # => :m
B.new.m # => :m
B.m rescue :undefined_method # => :undefined_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment