dimid
dimid

Reputation: 7631

How to reference an earlier output in pry

In python's ipython you can reference the output in the following way:

In [15]: s = "abcd"

In [16]: s
Out[16]: 'abcd'

In [17]: Out[16]
Out[17]: 'abcd'

What is the equivalent for ruby's pry?

Upvotes: 1

Views: 132

Answers (1)

dimid
dimid

Reputation: 7631

Using the _out_ and _in_ variables, as described in the docs.

E.g.: _out_[16] or _out_[-1] for the last result.

Upvotes: 1

Related Questions