method

private_class_method

v1_8_6_287 - Show latest stable - Class: Module
private_class_method(...)
public

Makes existing class methods private. Often used to hide the default constructor new.

   class SimpleSingleton  # Not thread safe
     private_class_method :new
     def SimpleSingleton.create(*args, &block)
       @me = new(*args, &block) if ! @me
       @me
     end
   end