fork download
  1. def func(&block)
  2. s = Object.new
  3. s.define_singleton_method(:wat) do
  4. puts "Ok"
  5. end
  6. yield s
  7. end
  8.  
  9. func do |my|
  10. my.wat
  11. end
  12.  
Success #stdin #stdout 0.01s 7460KB
stdin
Standard input is empty
stdout
Ok