Skip to content

Instantly share code, notes, and snippets.

@tskogberg
Created October 22, 2012 11:41
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 tskogberg/3931151 to your computer and use it in GitHub Desktop.
Save tskogberg/3931151 to your computer and use it in GitHub Desktop.
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