Skip to content

Instantly share code, notes, and snippets.

@madpilot
Created July 18, 2013 04:27
Show Gist options
  • Select an option

  • Save madpilot/6026715 to your computer and use it in GitHub Desktop.

Select an option

Save madpilot/6026715 to your computer and use it in GitHub Desktop.
class Foo
def this_fails
puts self.bar
end
def this_works
puts bar
end
private
def bar
"Foo#bar"
end
end
foo = Foo.new
foo.this_fails
NoMethodError: private method `bar' called for #<Foo:0x007fc68314e0a0>
foo.this_works
=> "Foo#bar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment