Exception: ConvenientService::Service::Plugins::ForbidsConvenientServiceEntitiesAsConstructorArguments::Exceptions::ServicePassedAsConstructorArgument Private

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(selector:, service:, other_service:) ⇒ Object

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.

Since:

  • 1.0.0



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb', line 14

def initialize_with_kwargs(selector:, service:, other_service:)
  message = "    Other service `\#{Utils::Class.display_name(other_service.class)}` is passed as constructor argument `\#{selector}` to `\#{Utils::Class.display_name(service.class)}`.\n\n    It is an antipattern. It neglects the idea of steps.\n\n    Please, try to reorganize `\#{Utils::Class.display_name(service.class)}` service.\n  TEXT\n\n  initialize(message)\nend\n"