Skip to content

Instantly share code, notes, and snippets.

@XmmmiR
Last active July 8, 2020 06:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save XmmmiR/17f1a67904166b3dfcb7 to your computer and use it in GitHub Desktop.
Save XmmmiR/17f1a67904166b3dfcb7 to your computer and use it in GitHub Desktop.
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