Injectable

io.github.makingthematrix.inject.Injectable
trait Injectable(module: Module)

Enables injecting dependencies with binding in the specified module or the default module if no other is specified.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final inline def inject[T : TypeName]: T

Injects a dependency with a binding specified in the trait.

Injects a dependency with a binding specified in the trait.

Example:

val module = new Module {
 bind[Foo] to Foo("foo")
}

class Bar extends Injectable(module):
 def foo: Foo = inject[Foo]

Type parameters

T

The type used in the binding

Attributes

Returns

An instance bound to the type T in the module specified in the trait