What is a ruby singleton method ?



What is a ruby singleton method ?..

Answer / Vikas Kumar Tiwari

A singleton method is a class method that can only be called on a specific class (or module) and not on its instances. It's called once for each class it belongs to during the lifetime of that class. In Ruby, you can create a singleton method using the class method 'def self.my_method'

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

Mention the log that has to be seen to report errors in Ruby Rails?

1 Answers  


what is the purpose of the resources method in the code snippet below?

1 Answers  


Where does the start_tabnav gets informations for tabs rendering in ruby rail?

1 Answers  


What is the functionality of Model views and controllers

2 Answers  


What is Dynamic finders ?

1 Answers  


What are the various components of rail?

1 Answers  


Choosing between belongs_to and has_one?

1 Answers  


Who designed active record in rails?

1 Answers  


Explain me what are the limits of ruby on rails?

1 Answers  


What role do sub-directory app/helpers and app/controllers play?

1 Answers  


Explain rails caching levels.

1 Answers  


Tell me what is the difference between the observers and callbacks in ruby on rails?

1 Answers  


Categories