VK
Size: a a a
VK
AI
ruby
class A
private
def private
'I am private of A'
end
protected
def protected
'I am protected of A'
end
end
ruby
class B < A
def call_private_of_A
private
end
def call_protected_of_A
protected
end
end
class Foo
private
def hidden_method
"hidden output"
end
end
class Bar < Foo
def test_hidden_method
self.hidden_method
end
end
Bar.new.test_hidden_method
AI
The definition of private in Ruby is "can only be called without an explicit receiver"
YD
The definition of private in Ruby is "can only be called without an explicit receiver"
VK
YD
VK
YD
YD
VK
AI
A¯
A¯
Discourse::Utils.class_eval do
self.execute_command
A¯
Discourse::Utils.class_eval do
self.execute_command
A¯
module ForumUtils
class Utils
private
class CommandRunner
private
def execute_command(*command, failure_message: "", success_status_codes: [0], chdir: ".")
//my code
end
end
end
def
VK
A¯
VK
A¯
A¯