There is such a line:
ruby -e "p 'hello world!'" What does p mean in ruby? What is the full name of p?
There is such a line:
ruby -e "p 'hello world!'" What does p mean in ruby? What is the full name of p?
The p() method is contained in the Kernel kernel module and prints the result of the obj.inspect call to the obj.inspect passed to it to the standard stream from the new line.
That is, in this case, it takes the object 'hello world!' , its inspect method calls which will return a string representation (the same 'hello world!' ) and output it from the new line to the standard output.
Source: https://ru.stackoverflow.com/questions/521292/
All Articles