On Sat, 22 Jan 2005 04:25:57 +0900, trans. <tsawyer / gmail.com> wrote:
> Traversable mixin! That would be great!

Would a single method, traverse_component be sufficient to build an
implementation on, do you think? Pass it a path component, and have the
object return whatever makes sense? (for a hash or array, map it to [];
for Objects in general, map it to send?)

Perhaps have a second method, traverse_filter, that receives an array of
filters, for XPath-style qualifications like [@attr = 'foo'], or
[/childobject]?

> As for API, probably best just would work out what your current needs
> are (I assume you have a current need ;-), and implement that first.
> Most of the rest wil probbly fall out from there, and then others can
> offer additional suggestion for functionaity. That's how I'd probbly
go
> about it, anyway.

My uses are, right now, for passing an object graph as model data to an
XTemplate view (something that Amrita does, and XTemplate does not,
yet), and for mapping a rails-style URL to an object graph of handlers
-- so that /foo/bar/baz maps to (roughly) startingpoint.foo.bar.baz

> Keep me informed and I'd be glad to help in any way I can.

Alright.

Ari

----
Ruby web hosting? http://theinternetco.net/offers/ruby