p=a*b
Domieszka is module declared at the beginning of my code, I dont put it
here
I’m not sure what’s in your Domieszka module, but in the code you
pasted, there are no methods b or b= in Rectangle; and there are no
methods a or a= in Square. The missing Rectangle#b= is why r.pole = 3
doesn’t work.
Also, since you include Domieszka in the superclass, there’s no need
to include it again in the subclass.
Oh, right – I forgot Square is a struct with a and a= defined on it.
Since you have
self.b = b
you need to define b=, e.g. by defining an accessor:
attr_accessor :b
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.