From: Robert Klemme Date: 2009-10-09T01:04:24+09:00 Subject: Mixing instance_eval and block with arguments Hi, here's what I'd like to do in a silly example: S = Struct.new :foo, :bar init = lambda do |a, b| self.foo = b self.bar = a + 10 end s = S.new # or create an instance otherwise # now comes the fun part which does not work s.instance_eval(1, 2, &init) => # In other words: I like to define a block as an initializer which I can store away somewhere and invoke that initializer later on in the context of "self" and pass arguments at the same time. Any ideas how I can accomplish this elegantly? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/