p, puts and print in Ruby
p obj
calls obj.inspect
and appends a new line to output.
put obj
calls obj.to_s
and appends a new line to output.
print obj
calls obj.to_s
but does not appends a new line to output.
Written by Yaodong Zhao
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#