Skip to content

Instantly share code, notes, and snippets.

@NZKoz
Created August 18, 2010 07:19
Show Gist options
  • Save NZKoz/533844 to your computer and use it in GitHub Desktop.
Save NZKoz/533844 to your computer and use it in GitHub Desktop.
irb(main):001:0> module Foo
irb(main):002:1> extend self
irb(main):003:1> def bar
irb(main):004:2> 1
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> Foo.bar
=> 1
irb(main):008:0> module Bar
irb(main):009:1> def foo
irb(main):010:2> 2
irb(main):011:2> end
irb(main):012:1> module_function :foo
irb(main):013:1> end
=> Bar
irb(main):014:0> Bar.foo
=> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment