Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3440

Re: Set attribute of superclass dynamically

From "Jeroen v." <jeroeningen@gmail.com>
Newsgroups comp.lang.ruby
Subject Re: Set attribute of superclass dynamically
Date 2011-04-24 12:13 -0500
Organization Service de news de lacave.net
Message-ID <81c6dca0642a6bf7c2031f06c826817b@ruby-forum.com> (permalink)
References <ebce7d6a4bf3664dc0904383f9352c21@ruby-forum.com>

Show all headers | View raw


You're right. I wrote the example code too quick.

In the meantime, I also found another solution that is good for me 
(however your solution would also worked):

In the module you can do:
self.send("#{method_name}=", value)
This creates a setter on the fly for the superclass ;)

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Set attribute of superclass dinamically "Jeroen v." <jeroeningen@gmail.com> - 2011-04-24 09:29 -0500
  Re: Set attribute of superclass dynamically Brian Candler <b.candler@pobox.com> - 2011-04-24 11:00 -0500
  Re: Set attribute of superclass dynamically "Jeroen v." <jeroeningen@gmail.com> - 2011-04-24 12:13 -0500
    Re: Set attribute of superclass dynamically Brian Candler <b.candler@pobox.com> - 2011-04-24 14:50 -0500
  Re: Set attribute of superclass dinamically Josh Cheek <josh.cheek@gmail.com> - 2011-04-24 12:29 -0500

csiph-web