Skip to content

Instantly share code, notes, and snippets.

@kikito
Created August 18, 2011 12:20
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 kikito/1153947 to your computer and use it in GitHub Desktop.
Save kikito/1153947 to your computer and use it in GitHub Desktop.
Don't use self.methodname if methodname is private
class A
def foo
baz
end
def bar
self.baz
end
private
def baz
"baz"
end
end
a = A.new
a.foo #works ok
a.bar #throws "Attempt to call private method" error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment