Sha256: fa8d035540fdde67d836552a96b4abcf20423c0237722d3544552eafb8fdd95f

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Feature
    module Plugins
      module CanHaveEntries
        module Exceptions
          class NotDefinedEntryMethod < ::ConvenientService::Exception
            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
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb
convenient_service-0.19.0 lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb
convenient_service-0.18.0 lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb
convenient_service-0.17.0 lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb