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

Class Method Summary collapse

Class Method Details

.export(slug, scope: Constants::DEFAULT_SCOPE, &body) ⇒ ConvenientService::Support::DependencyContainer::Entities::Method

Parameters:

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

Returns:



30
31
32
33
34
# File 'lib/convenient_service/support/dependency_container/export.rb', line 30

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



39
40
41
# File 'lib/convenient_service/support/dependency_container/export.rb', line 39

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