Exception: ConvenientService::Service::Plugins::CanNotBeInherited::Exceptions::ServiceIsInherited

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

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(service_class:, sub_service_class:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/convenient_service/service/plugins/can_not_be_inherited/exceptions.rb', line 9

def initialize_with_kwargs(service_class:, sub_service_class:)
  message = <<~TEXT
    Service `#{Utils::Class.display_name(sub_service_class)}` is inherited from `#{Utils::Class.display_name(service_class)}`.

    It is an antipattern. It neglects the idea of steps.

    Please, try to reorganize `#{Utils::Class.display_name(sub_service_class)}` service.
  TEXT

  initialize(message)
end