Skip to content

Instantly share code, notes, and snippets.

@SpringMT
Last active August 29, 2015 14:09
Show Gist options
  • Save SpringMT/91a944ff5d01e75902be to your computer and use it in GitHub Desktop.
Save SpringMT/91a944ff5d01e75902be to your computer and use it in GitHub Desktop.
class A
class << self
def hoge
private_hoge
end
private
def private_hoge
p 'hoge'
end
end
end
A.hoge
A.private_hoge
@SpringMT
Copy link
Author

% ruby  class_priavte.rb
"hoge"
class_priavte.rb:14:in `<main>': private method `private_hoge' called for A:Class (NoMethodError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment