Exception: ConvenientService::Feature::Plugins::CanHaveEntries::Exceptions::NotDefinedEntryMethod

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

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(name:, feature:) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb', line 14

def initialize_with_kwargs(name:, feature:)
  message = <<~TEXT
    Entry for `#{name}` is registered inside `#{feature.class}` feature, but its corresponding method is NOT defined.

    Did you forget to define it? For example, using method form:

    class #{feature.class}
      entry :#{name}

      # ...

      def #{name}(...)
        # ...
      end

      # ...
    end

    Or using block form:

    class #{feature.class}
      entry :#{name} do |*args, **kwargs, &block|
        # ...
      end

      # ...
    end
  TEXT

  initialize(message)
end