Module: Injectable::Macros
- Defined in:
- lib/injectable/macros.rb
Overview
Provides class level macros for setting up dependencies.
Instance Method Summary collapse
-
#dependencies(*injectables) ⇒ Object
Sets up the dependencies for the class.
Instance Method Details
#dependencies(*injectables) ⇒ Object
Note:
A constructor will get created for the object that takes the same number or arguments as provided to the dependencies macro. The types of these arguments must match the “classified” name of the provided symbol. For example :user would be a User class, :user_finder would be a UserFinder class. Order matters.
Sets up the dependencies for the class.
29 30 31 32 33 |
# File 'lib/injectable/macros.rb', line 29 def dependencies(*injectables) define_constructor(*injectables) define_readers(*injectables) Registry.register_signature(self, injectables) end |