p

p(obj) â obj
p(obj1, obj2, ...) â [obj, ...]
p() â nil
Instance Public methods

For each object, directly writes obj.inspect followed by a newline to the program's standard output.

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

produces:

#<S name="dave", state="TX">
doc_ruby_on_rails
2015-04-17 11:11:21
Comments
Leave a Comment

Please login to continue.