com.escalatesoft.subcut.inject
A companion object holding a convenience method to create new binding modules on the fly when passed a function from MutableBindingModule to unit.
to use this class:
import NewBindingModule._ implicit val bindingModule = newBindingModule { module => import module._ bind [DBLookup] toProvider { module => new MySQLLookup(module) } // could use implicit module => instead bind [WebService] to newInstanceOf [RealWebService] bind [Int] identifiedBy 'maxPoolSize toSingle 10 // could also use idBy instead of identifiedBy bind [QueryService] toSingle { new SlowInitQueryService } }
A companion object holding a convenience method to create new binding modules on the fly when passed a function from MutableBindingModule to unit.
to use this class: