Last active
December 16, 2015 17:49
-
-
Save tokiwoousaka/5473224 to your computer and use it in GitHub Desktop.
Rubyのクラス何でも出来すぎだろコレ
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
class Foo | |
def hoge | |
print "HogeHoge\n" | |
end | |
end | |
F = Foo.new | |
F.hoge | |
class Foo | |
def piyo | |
print "PiyoPiyo\n" | |
end | |
end | |
F.piyo | |
class Foo | |
def hoge | |
print "Fuga\n" | |
end | |
end | |
F.hoge | |
print "-----------------------------\n" | |
class Bar < Foo | |
def huga | |
print "HogeraGera\n" | |
end | |
end | |
B = Bar.new | |
B.hoge | |
B.piyo | |
B.huga | |
print "-----------------------------\n" | |
class Foo | |
def hoge | |
print "HogegeHogeHoge\n" | |
end | |
end | |
F.hoge | |
B.hoge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment