InterviewSolution
| 1. |
What Is A Ruby Singleton Method ? |
|
Answer» A METHOD which belongs to a single object rather than to an entire class and other objects. Before explaining about singleton methods I would LIKE to give a small introduction about class methods. Class method: When you write your own class methods you do so by prefacing the method NAME with the name of the class. There are three ways to write a class method.
A method which belongs to a single object rather than to an entire class and other objects. Before explaining about singleton methods I would like to give a small introduction about class methods. Class method: When you write your own class methods you do so by prefacing the method name with the name of the class. There are three ways to write a class method. |
|