Constructor overriding

后端 未结 1 1366
无人共我
无人共我 2020-12-10 11:22

I have a class:

class One
  def initialize; end
end

I need to create a new class with my own constructor like this:

class T         


        
相关标签:
1条回答
  • 2020-12-10 11:45

    super in this case (without parentheses) is a special form. It calls the superclass method with the original params.

    Instead try calling

    super()
    
    0 讨论(0)
提交回复
热议问题