From: Robert Klemme Date: 2012-10-15T17:27:40+09:00 Subject: Re: About define_method On Mon, Oct 15, 2012 at 9:49 AM, Ryan Davis wrote: > > On Oct 15, 2012, at 00:15 , Robert Klemme wrote: > >> $ ruby -e 'module Kernel;define_method(foo) { yield 1 };end;foo {|x| p x}' >> -e:1:in `': undefined local variable or method `foo' > > you meant :foo Yes, of course. Thanks for catching that. Then we get $ ruby -e 'module Kernel;define_method(:foo) { yield 1 };end;foo {|x| p x}' -e:1:in `block in ': no block given (yield) (LocalJumpError) from -e:1:in `
' Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/