Why do you want to have to_s,to_str,inspect these three functions at the same time in Ruby? Why is nil.inspect “nil”

  question, ruby

Ruby novice, ask Great Xia for advice.

First question:
To_s should be a widely available method, to_str should be a String or a method that is unique to a few classes. Ruby does have many ways,https://ruby-china.org/topics/25311.

Second question:
The inspect return type is string, which returns a string that shows the current object for easy reading. Nil.inpsect return"nil"Because he is returning"nil"Look at the NilClass#inspect document.