From: "Ara.T.Howard" Date: 2006-02-10T06:42:06+09:00 Subject: Re: How to improve this kind of API? On Thu, 9 Feb 2006, Lyle Johnson wrote: > On 2/9/06, ara.t.howard@noaa.gov wrote: > >> indeed. a symbols only api is evil - makes reading config info from >> files/yaml a pain.... > > > >> which makes >> >> splitter.configure(YAML::load(IO:;read('config.yml'))) >> >> a one liner. >> >> if config.yml has >> >> --- >> expand : top_left >> something : foobar >> >> in it. > > How would one specify (especially in the YAML representation) that > both the "top_left" and "top_right" bits for "expand" should be set? > Would it look something like this: > > --- > expand: > - top_left > -top_right > something: foobar > > I don't have as much exposure to YAML as I probably should. ;) exactly right. btw. it's easy to figure out: harp:~ > ruby -r yaml -e' y "expand" => ["top_left", "top_right"], "foo" => "bar" ' --- expand: - top_left - top_right foo: bar cheers. -a -- happiness is not something ready-made. it comes from your own actions. - h.h. the 14th dali lama