2010/1/28 Robert Klemme <shortcutter / googlemail.com>:
> 2010/1/28 Gene Shuman <geneshuman / gmail.com>:
>> Actualy, I can do that. =A0I just need to modify it externally afterward=
s
>> by name.
>
> What exactly are you trying to do? =A0Here's one way:
>
> module Foo
> =A0attr_accessor :bar
> end
>
> String.extend Foo
>
> irb(main):009:0> String.bar =3D "nonsense"
> =3D> "nonsense"
> irb(main):010:0> String.bar
> =3D> "nonsense"
> irb(main):011:0>

PS: this is not a class variable in the "classical" sense, e.g. a
variable starting with "@@" (e.g. @@bar).  It's an instance variable
of the class.

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/