Exception: ConvenientService::Core::Entities::Config::Exceptions::TooManyCommitsFromMethodMissing

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/core/entities/config/exceptions.rb

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(config:) ⇒ void

This method returns an undefined value.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/convenient_service/core/entities/config/exceptions.rb', line 35

def initialize_with_kwargs(config:)
  message = <<~TEXT
    `#{config.klass}` config is committed too many times from `method_missing`.

    In order to resolve this issue try to commit it manually before usage of any config-dependent method.

    Example 1 (outside class):

      # Commitment:
      #{config.klass}.commit_config!

      # Few lines later - usage:
      #{config.klass}.result # or whatever method.

    Example 2 (inside class):

      class #{config.klass}
        # ...
        commit_config!

        step :result # or any other method that becomes available after config commitment.
      end
  TEXT

  initialize(message)
end