Exception: Invokr::OptionalPositionalArgumentError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/invokr/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, arg1, arg2) ⇒ OptionalPositionalArgumentError

Returns a new instance of OptionalPositionalArgumentError.



61
62
63
64
65
66
67
# File 'lib/invokr/errors.rb', line 61

def initialize method, arg1, arg2
  @message = <<-MESSAGE
method `#{method}' has optional positional argument `#{arg2}', after optional argument `#{arg1}'.

We cannot use this method because there's no way to supply an explicit value for `#{arg2}' without knowing the default value for `#{arg1}'. It's technically possible to overcome this with S-expression analysis, but a much simpler solution would be to use keyword arguments.
  MESSAGE
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



59
60
61
# File 'lib/invokr/errors.rb', line 59

def message
  @message
end