Skip to content

Instantly share code, notes, and snippets.

@acook
Created April 3, 2014 22:27
Show Gist options
  • Select an option

  • Save acook/9964142 to your computer and use it in GitHub Desktop.

Select an option

Save acook/9964142 to your computer and use it in GitHub Desktop.
public
protected
NoMethodError: private method `pri_bar' called for #<Foo:0x007f8376ae2d28>
from (pry):10:in `other_bar'
class Foo
public
def pub_bar
puts "public"
end
def other_bar other
other.pub_bar
other.pro_bar
other.pri_bar
end
protected
def pro_bar
puts "protected"
end
private
def pri_bar
puts "private"
end
end
f1 = Foo.new
f2 = Foo.new
f2.other_bar f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment