Created
July 28, 2015 19:28
-
-
Save nirvdrum/21d239cddc526767166a to your computer and use it in GitHub Desktop.
This file contains 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
class A | |
# There is Kernel#public_method, so we don't want this one to clash | |
def pub_method; :public_method; end | |
def undefed_method; :undefed_method; end | |
undef_method :undefed_method | |
protected | |
def protected_method; :protected_method; end | |
private | |
def private_method; :private_method; end | |
public | |
define_method(:defined_method) { :defined } | |
end | |
p A.new.respond_to?(:protected_method, false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment