Skip to content

Instantly share code, notes, and snippets.

@artemk
Created November 15, 2011 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artemk/1366336 to your computer and use it in GitHub Desktop.
Save artemk/1366336 to your computer and use it in GitHub Desktop.
module A
def meth2
meth1
end
private
def meth1
puts "AAAQWE"
end
end
class B
include A
end
B.new.meth1 #=> NoMethodError: private method ‘meth1’ called for #<B:0x00000100865e88>
B.new.meth2 #=> "AAAQWE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment