Wirebox to external CFC

I am loving Wirebox, just have a question about settings.

I want to map a CFC that is not in my coldbox root directory using the new Wirebox stuff.

I was able to do it by saying

wirebox.mappings[“Settings”] = {
type=this.TYPES.CFC,
path=“com.utils.Settings”,
eagerInit = true,
scope=this.SCOPES.SINGLETON
};

This works fine, but I was wondering what the right way of doing it is via methods?

I tried map(“Settings”).to(“com.utils.Settings”), and mapPath(“com.utils.Settings”), and I kept getting a warning that the dependency injection did not work?

Any thoughts?

Hmm, I would do this:

map(“Settings”)
.to(“com.utils.Settings”)
.asSingleton()
.eagerInit();

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com