Created
March 21, 2012 14:59
-
-
Save omarqureshi/2148006 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
1.8.7 :001 > autoload :MyLibrary, 'my_library' | |
=> nil | |
1.8.7 :002 > module FooModule | |
1.8.7 :003?> def foo | |
1.8.7 :004?> puts 'new foo' | |
1.8.7 :005?> end | |
1.8.7 :006?> end | |
=> nil | |
1.8.7 :007 > class MyLibrary | |
1.8.7 :008?> include FooModule | |
1.8.7 :009?> end | |
=> MyLibrary | |
1.8.7 :010 > MyLibrary.new.foo | |
original foo |
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 MyLibrary | |
def foo | |
puts 'original foo' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment