Module: ConvenientService::Support::DependencyContainer::Import Private
- Includes:
- Concern
- Defined in:
- lib/convenient_service/support/dependency_container/import.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
Methods included from Concern
Class Method Details
.import(slug, from:, as: Support::NOT_PASSED, scope: Constants::DEFAULT_SCOPE, prepend: Constants::DEFAULT_PREPEND) ⇒ ConvenientService::Support::DependencyContainer::Entities::Method
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/convenient_service/support/dependency_container/import.rb', line 23 def import(slug, from:, as: Support::NOT_PASSED, scope: Constants::DEFAULT_SCOPE, prepend: Constants::DEFAULT_PREPEND) Commands::AssertValidScope.call(scope: scope) Commands::AssertValidContainer.call(container: from) Commands::AssertValidMethod.call(slug: slug, scope: scope, container: from) method = from.exported_methods.find_by(slug: slug, scope: scope) method = method.copy(overrides: {kwargs: {alias_slug: as}}) unless Support::NOT_PASSED[as] Commands::ImportMethod.call(importing_module: self, exported_method: method, prepend: prepend) end |