Exception: ConvenientService::Support::DependencyContainer::Exceptions::NotExportedMethod

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/support/dependency_container/exceptions.rb

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(method_name:, method_scope:, mod:) ⇒ void

This method returns an undefined value.

Parameters:

  • method_name (String)
  • method_scope (Symbol)
  • mod (Module)


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/convenient_service/support/dependency_container/exceptions.rb', line 55

def initialize_with_kwargs(method_name:, method_scope:, mod:)
  message = <<~TEXT
    Module `#{mod}` does NOT export method `#{method_name}` with `#{method_scope}` scope.

    Did you forget to export it from `#{mod}`? For example:

    module #{mod}
      export #{method_name}, scope: :#{method_scope} do |*args, **kwargs, &block|
        # ...
      end
    end
  TEXT

  initialize(message)
end