slabserif23
slabserif23

Reputation: 495

What does "$>" represent in Ruby documentation?

As in:

def PP.pp(obj, out=$>, width=79)
...

This is from the pp method of the PP class:
http://www.ruby-doc.org/stdlib-2.0/libdoc/pp/rdoc/PP.html#method-c-pp

Upvotes: 1

Views: 80

Answers (1)

Linuxios
Linuxios

Reputation: 35803

$> is the IO destination for Kernel#print (and therefore puts), and other output methods. It defaults to $stdout, but can be changed to change the behavior of print, printf, puts, etc.

Upvotes: 2

Related Questions