Skip to content

Instantly share code, notes, and snippets.

@brixen
Created September 13, 2009 19:08
Show Gist options
  • Select an option

  • Save brixen/186288 to your computer and use it in GitHub Desktop.

Select an option

Save brixen/186288 to your computer and use it in GitHub Desktop.
gauss:rubinius brian$ irb
>> module M
>> private
>> def foo
>> puts 'foo'
>> end
>> end
=> nil
>> class F
>> include M
>> def bar
>> puts 'bar'
>> foo
>> end
>> end
=> nil
>> f = f.new
NoMethodError: undefined method `new' for nil:NilClass
from (irb):14
>> f = F.new
=> #<F:0x5e78b0>
>> f.bar
bar
foo
=> nil
>> f.foo
NoMethodError: private method `foo' called for #<F:0x5e78b0>
from (irb):17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment