Created
August 5, 2010 15:59
-
-
Save lukeredpath/509940 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 TestClass | |
| def do_something | |
| puts "Doing something" | |
| end | |
| end | |
| module TestModule | |
| def do_something | |
| super | |
| puts "Doing something else" | |
| end | |
| end | |
| test = TestClass.new | |
| test.extend(TestModule) | |
| test.do_something | |
| # => "Doing something" | |
| # => "Doing something else" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment