Created
August 18, 2010 07:19
-
-
Save NZKoz/533844 to your computer and use it in GitHub Desktop.
This file contains 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
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