> On another note it looks like the rule blocks are being class eval'd, so
> my `origin` instance method isn't even in scope. I'm passing it in when
> I call #apply, but is there a better way?

Class eval it is. But really, don't mix your code into the transformer,
rather create a document that you pass around. Concerns like to be kept
well apart.

Here's how that might look like:

        doc = Document.new
        transform.apply(int_tree, document: doc)

and in your rules:

        rule(:foo => simple(:foo)) { document.add_foo(foo) }
        rule(:foo => simple(:foo)) { |dict|
          dict[:document].add_foo(dict[:foo]) }

I realize that there is next to no documentation for this, but I
consider it an official feature! And hey, the mailing list is a start,
perhaps someone wants to contribute documentation for a change?

real nice greetings
kaspar



Reply via email to