23
Mam klasy:Konstruktor nadrzędnymi
class One
def initialize; end
end
trzeba utworzyć nową klasę z własnego konstruktora jak ten:
class Two < One
def initialize(some)
puts some
super
end
end
Two.new("thing")
ale kiedy uruchomić kod, mam błąd:
thing
test.rb:10:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)
Dokumenty: [nadklasą] (http://apidock.com/ruby/Class/superclass) w apidock –