Skip to content

Instantly share code, notes, and snippets.

@aereal
Created Jun 7, 2010
Embed
What would you like to do?
class Greeting
def hello; end
private do
def bonjour; end
end
protected do
def guten_morgen; end
end
end
klass = Class.new
Greeting.public_instance_methods - klass.public_instance_methods # => ["hello"]
Greeting.private_instance_methods - klass.private_instance_methods # => ["bonjour"]
Greeting.protected_instance_methods - klass.protected_instance_methods # => ["guten_morgen"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment