To "display the return value of a method in the terminal"

puts method name

Should be written outside the method?
Is there any other way?
Please write your question in detail here.
(Example) I am making a ●● system with PHP (CakePHP).
■■ The following error message occurred while implementing the function.

Error message
Corresponding source code
Source code
What I tried

Please describe here what you have tried for the problem.

Supplementary information (FW/tool version, etc.)

Please provide more detailed information here.