------=_Part_27645_15304138.1128911235631
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
To Christophe Grandsire:
I tried both suggestions but I still can't get them to work. Could you
elaborate futher?
To Robert Klemme:
I know about attr_*, but this is a bit different: instead of using
"attr=3Dval" to set an attribute, this uses "attr val" (val being an
argument). I'd rather do it this way because the seemingly miniscule
improvement in looks gets a lot nicer looking in the particular instance
that I'm using it in:
world do
title "A Title"
author "An Author"
end
world is a method that creates a World object and instance_evals the block.
Now, if I were to just use "attr_accessor :title, :author", I would have to
do this:
world do
@title =3D "A Title"
@author =3D "An Author"
end
That's a lot uglier and a bit more obtrusive. If you haven't guessed
already, I'm making a text adventure. I'd like the story-definition DSL to
look as clean as possible. Yes, I know about the recent Ruby Quiz entry, bu=
t
I'm trying not to look at the solutions' code too much or else I'd be
tempted to copy...
Chris
------=_Part_27645_15304138.1128911235631--