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 |
What are the different uses of ruby modules?
What are Ruby iterators?
How to access Ruby array elements? How many methods are used to access Ruby elements?
What are advantages of using ruby?
Tell me an array [1,2,34,5,6,7,8,9], product it using a method?
difference between activesupport's “hashwithindifferentaccess” and ruby's “hash”?
Who is the developer of Ruby?
Please explain the three levels of access control for ruby methods?
Tell me what is the difference between active support's “hashwithindifferent” and ruby's “hash” ?
How do you handle exceptions in ruby code?
Explain about the command line options?
What is ruby?