Skip to content

Instantly share code, notes, and snippets.

@jacegu
Created February 13, 2011 20:01
Show Gist options
  • Save jacegu/825047 to your computer and use it in GitHub Desktop.
Save jacegu/825047 to your computer and use it in GitHub Desktop.
An example of declaring visibility of existing methods in Ruby.
class EvenMoreAccessControlExamples
def public_by_default
end
def protected_method
end
def this_is_public_too
end
def private_method
end
protected :protected_method
public :public_by_default, :this_is_public_too
private :private_method
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment