Module: Carioca::Injector
- Included in:
- Container, Services::SecureStore
- Defined in:
- lib/carioca/mixin.rb
Class Method Summary collapse
Instance Method Summary collapse
- #active_services ⇒ Object
- #add(service:, definition:) ⇒ Object
- #create_methods(name) ⇒ Object
- #inject(service:) ⇒ Object
- #services ⇒ Object
Class Method Details
.extended(base) ⇒ Object
26 27 28 |
# File 'lib/carioca/mixin.rb', line 26 def self.extended(base) base.include self end |
Instance Method Details
#active_services ⇒ Object
17 18 19 |
# File 'lib/carioca/mixin.rb', line 17 def active_services Carioca::Registry.get.active_services end |
#add(service:, definition:) ⇒ Object
9 10 11 |
# File 'lib/carioca/mixin.rb', line 9 def add(service:, definition:) Carioca::Registry.get.add service:, definition: end |
#create_methods(name) ⇒ Object
21 22 23 24 |
# File 'lib/carioca/mixin.rb', line 21 def create_methods(name, &) define_method(name, &) self.class.send(:define_method, name, &) end |