Module: ConvenientService::Support::DependencyContainer::Export Private

Includes:
Concern
Defined in:
lib/convenient_service/support/dependency_container/export.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.

Since:

  • 1.0.0

Class Method Summary collapse

Methods included from Concern

included

Class Method Details

.export(slug, scope: Constants::DEFAULT_SCOPE, &body) ⇒ 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.

Parameters:

  • slug (String, Symbol)
  • scope (:instance, :class) (defaults to: Constants::DEFAULT_SCOPE)
  • body (Proc)

Returns:

Since:

  • 1.0.0



35
36
37
38
39
# File 'lib/convenient_service/support/dependency_container/export.rb', line 35

def export(slug, scope: Constants::DEFAULT_SCOPE, &body)
  Commands::AssertValidScope.call(scope: scope)

  Entities::Method.new(slug: slug, scope: scope, body: body).tap { |method| exported_methods << method }
end

.exported_methodsConvenientService::Support::DependencyContainer::Entities::MethodCollection

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.



44
45
46
# File 'lib/convenient_service/support/dependency_container/export.rb', line 44

def exported_methods
  @exported_methods ||= Entities::MethodCollection.new
end