method

p

v1_8_6_287 - Show latest stable - Class: Kernel
p(...)
public

For each object, directly writes obj.inspect followed by the current output record separator to the program’s standard output.

   S = Struct.new(:name, :state)
   s = S['dave', 'TX']
   p s

produces:

   #<S name="dave", state="TX">