I have a problem constructing the to_s method.
attr_accessor :prenom, :nom, :email, :telephone, :adresse
@prenom = @nom = @email = @telephone = ""
@adresse = Adresse.new
@prenom + ", " + @nom + "\n" + \
"Email: " + @email + "\n" + \
"Tel: " + @telephone + "\n" + \
in `+': no implicit conversion of Adresse into String (TypeError)
I do not understand the issue, since address object has it's own print method.
You are passing an instance of class
Adresse as an argument to
+ method, called on string, it throws an error, because it expects an instance of String class as an argument.
To make this work you would want to convert it to string using, for instance,
+ @adresse.to_s # would do it for you