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 is the difference between static and dynamic scaffolding?
Tell us the types of variables available in ruby class?
difference between activesupport's “hashwithindifferentaccess” and ruby's “hash”?
Tell me how can you declare a block in ruby?
How would you freeze an object in ruby? Can you provide a simple example?
What must you do first before you can invoke an unboundmethod object?
Tell me how can we define ruby regular expressions?
What is a struct in ruby?
What are the key features of ruby?
what is the difference extend and include?
What is yield in ruby?
Explain break statement in Ruby?