[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Is better to subclass or to add methods to an existing class?
From:       Paul Brannan <pbrannan () atdesk ! com>
Date:       2002-09-19 21:26:01
[Download RAW message or body]

On Fri, Sep 20, 2002 at 05:41:58AM +0900, Christoph wrote:
> Beast = self
> (@temptation = Class.new String).class_eval <<-Body
> Beast = self
> def six_six_six; Beast end
> Body

What's wrong with:

  Beast = self
  (@temptation = Class.new String).class_eval do
    Beast = self
    def six_six_six; Beast end
  end

Paul

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic