[#964] Bastion or SecurityManager for Ruby? — Clemens Hintze <clemens.hintze@...>

Hi,

15 messages 1999/12/10

[#989] a question about to_i — Friedrich Dominicus <Friedrich.Dominicus@...>

Sorry, I'm quite new to ruby. But I encounterd the following problem. If

17 messages 1999/12/19

[ruby-talk:01010] Re: Reparenting a block

From: Masaki Fukushima <fukusima@...>
Date: 1999-12-31 07:32:57 UTC
List: ruby-talk #1010
Hi,

Dave Thomas <Dave@thomases.com> wrote:
>    class Dave
>       def initialize(&block)
>          ??
>       end
> 
>       def fred
>          print "In fred\n"
>       end
>    end

> the object created by Dave.new? I've tried instance_eval, but I don't
> seem to be able to get it so work with a variable containing a block.

Really?
Following seems to work as you want.

       def initialize(&block)
          instance_eval(&block)
       end

---
Masaki Fukushima

In This Thread