Skip to content

Instantly share code, notes, and snippets.

@jpignata
Created June 5, 2011 01:41
Show Gist options
  • Save jpignata/1008564 to your computer and use it in GitHub Desktop.
Save jpignata/1008564 to your computer and use it in GitHub Desktop.
class A
def protected_method
puts "success"
end
protected :protected_method
end
class B < A
def public_method
puts "B"
A.new.protected_method
end
end
class C
def public_method
puts "C"
A.new.protected_method
end
end
B.new.public_method
C.new.public_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment