Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Created March 21, 2012 14:59
Show Gist options
  • Save omarqureshi/2148006 to your computer and use it in GitHub Desktop.
Save omarqureshi/2148006 to your computer and use it in GitHub Desktop.
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
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