Last active
July 29, 2016 04:33
-
-
Save vireshas/ec22cba9c98ab113738a9e036fc9549f to your computer and use it in GitHub Desktop.
mixin in sub-class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module C | |
def a | |
puts "a" | |
end | |
end | |
class A | |
include C | |
end | |
class B < A | |
end | |
B.new.a | |
>> ruby mixin_in_subclass.rb | |
a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment