Is it possible to see the ruby code in a proc?

block, proc, ruby

Solution

Take a look at the sourcify gem:

proc { x + y }.to_source
# >> "proc { (x + y) }"

Problem

``` p = Proc.new{ puts 'ok' } ``` Is is possible to see the ruby code in the proc? `inspect` returns the memory location: ``` puts p.inspect #<Proc:0x007f9e42980b88@(irb):2> ``` Ruby 1.9.3

Original source

Related problems