Created
October 22, 2012 11:41
-
-
Save tskogberg/3931151 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 String | |
def hello | |
puts "hello from String" | |
end | |
end | |
class MyString < String | |
def hello | |
puts "hello from MyString" | |
end | |
end | |
module StringExtentions | |
def hello | |
puts "hello from module" | |
end | |
end | |
s1 = String.new | |
s1.hello | |
s2 = MyString.new | |
s2.hello | |
s1.extend(StringExtentions) | |
s1.hello | |
s2.extend(StringExtentions) | |
s2.hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment