-
-
Save XmmmiR/17f1a67904166b3dfcb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestC | |
def self.call_everyone obj | |
obj.public_method | |
obj.protected_method | |
obj.private_method | |
end | |
def call_everyone obj | |
obj.public_method | |
obj.protected_method | |
obj.private_method | |
end | |
def public_method | |
puts "I'm public" | |
end | |
protected | |
def protected_method | |
puts "I'm protected, can you see me?" | |
end | |
private | |
def private_method | |
puts "I'm private" | |
end | |
end | |
test_obj = TestC.new | |
TestC.call_everyone test_obj | |
# TestC.new.call_everyone test_obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment