Make new private : private_class_method « Reflection « Ruby






Make new private


class MyLogger
  private_class_method :new
  @@logger = nil
  def MyLogger.create
    @@logger = new unless @@logger
    @@logger
  end
end

 








Related examples in the same category