Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Using a result as a constant object?
Phy Prabab
10/19/2008 6:21:00 PM
Brian,
Ah, I see now (said the blind man)! This cool! Thanks for the example, much appreciated!
Cheers,
Phy
--- On Sun, 10/19/08, Brian Candler <b.candler@pobox.com> wrote:
> From: Brian Candler <b.candler@pobox.com>
> Subject: Re: Using a result as a constant object?
> To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
> Date: Sunday, October 19, 2008, 1:03 PM
> Phy Prabab wrote:
> > I am trying to understand how I can use a return from
> a method as a
> > constant name for a class.
>
> def get_name
> "Foo"
> end
>
> n = get_name
> c = Class.new(ActiveRecord::Base) # superclass
> Object.const_set(n, c)
> --
> Posted via
http://www.ruby-...
.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Using a result as a constant object?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password