我有一堂课:
class One
def initialize; end
end
我需要使用自己的构造函数创建一个新类,如下所示:
class Two < One
def initialize(some)
puts some
super
end
end
Two.new("thing")
但是当我启动代码时,出现错误:
thing
test.rb:10:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)