Tell me can you call a private method outside a ruby class using its object?
Answer / Manoj Kumar Rajput
Private methods in Ruby are not accessible outside of the class where they are defined. You cannot directly call a private method on an instance from outside the class. However, there are some workarounds such as using singleton classes or module functions.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain about class libraries in ruby?
Is ruby supports single inheritance/ multiple inheritance or both?
Explain about the command line options?
How many types of associations relationships does a model has?
Explain Ruby exceptions?
What method might you use to remove duplicate values from an array?
Tell me how you define instance variable, global variable and class variable in ruby?
What is mvc? And how it works?
What is rvm?
Tell me what are blocks and procs?
How do the following methods differ: @my_string.strip and @my_string.strip! ?
What is the pattern matching operator in ruby?