Skip to content

Instantly share code, notes, and snippets.

@aurelian
Created November 14, 2012 10:23
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 aurelian/4071388 to your computer and use it in GitHub Desktop.
Save aurelian/4071388 to your computer and use it in GitHub Desktop.
class Foo
def destroy
puts "destroyed!"
end
end
class Bar < Foo
private :destroy
end
b= Bar.new
b.destroy
### priv.rb:15:in `<main>': private method `destroy' called for #<Bar:0x0000010086b298> (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment