Created
September 3, 2008 04:04
-
-
Save jackdempsey/8534 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
Last login: Tue Sep 2 21:05:10 on ttys000 | |
~ $ irb | |
irb(main):001:0> module Foo | |
irb(main):002:1> def self.bar | |
irb(main):003:2> puts 'here in bar' | |
irb(main):004:2> end | |
irb(main):005:1> end | |
=> nil | |
irb(main):006:0> class Bar | |
irb(main):007:1> include Foo | |
irb(main):008:1> end | |
=> Bar | |
irb(main):009:0> Bar.bar | |
NoMethodError: undefined method `bar' for Bar:Class | |
from (irb):9 | |
from :0 | |
irb(main):010:0> class Bar | |
irb(main):011:1> extend Foo | |
irb(main):012:1> end | |
=> Bar | |
irb(main):013:0> Bar.bar | |
NoMethodError: undefined method `bar' for Bar:Class | |
from (irb):13 | |
from :0 | |
irb(main):014:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment