This is an example similar to the one here:
@var = “var”
“This is a customized string”
var = Foo.new
There are some scenarios I’m doing here:
1- When I remove “def to_s” method, and for “puts var”, I change it as
2- in “def to_s”:
3- Running the code as it is shown at the top.
Result: “This is a customized string”
4- Without “def to_s”.
The most parts that are confusing me here are scenarios (1) and (4). Why
are the following results? And, what do those results mean by the way?