Accessing data from external classes

Hi

I’m using data/ to store and retrieve data among multiple documents inside a MM app.
This works as supposed, I can access the data hash from my documents.

I wrote a couple of classes that depend on the data, to make things more structured.
Classes are required in the config file.

Question: I need to access the data hash from my classes. How can I ?
I guess it is attached to the instance of Middleman::Application, but how do I find it ?
Is there a global variable storing the data or even better the whole app ?
(in an extension, it is passed at registration time. Does that mean the answer is no ?)

For now, I pass the data hash as an argument when I call my custom class,
but this is clearly not DRY nor clean.

Thank you.
raphael.

Not a direct answer to your question, but when wondering about things like that, I use debug to stop Middleman at an appropriate place, and then poke around in the internal attributes until I find what I need (it can be somewhat tricky since a lot of stuff that looks like it should be an attribute is actually a method).

One way to do it: Debugging Middleman using RubyMine

Thanks.
I look a lot around, poking into the class’s instances, the console and the source, but all solution were very hacky.
I could also set things up in the config file (actually that’s the road I’m taking), but I feel it does way more than it should do.