Exception: Dry::CLI::InvalidCallbackError

Inherits:
Error
  • Object
show all
Defined in:
lib/dry/cli/errors.rb

Overview

Since:

  • 0.2.0

Instance Method Summary collapse

Constructor Details

#initialize(callback) ⇒ InvalidCallbackError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InvalidCallbackError.

Since:

  • 0.2.0



25
26
27
28
29
30
31
32
33
34
# File 'lib/dry/cli/errors.rb', line 25

def initialize(callback)
  message = case callback
            when Class
              "expected `#{callback.inspect}' to respond to `#initialize' with arity 0"
            else
              "expected `#{callback.inspect}' to respond to `#call'"
            end

  super(message)
end