How to make the class constructor private in Ruby?

前端 未结 3 1919
北荒
北荒 2020-12-08 06:10
class A
private
  def initialize
    puts \"wtf?\"
  end
end

A.new #still works and calls initialize

and

class A
private
  def sel         


        
3条回答
提交回复
热议问题