method

p

v1_9_1_378 - Show latest stable - Class: Kernel
p(*args)
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">