Exception: WiseGopher::ArgumentError

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

Overview

raised when ‘execute` is called whereas query needs params or `execute_with` did not provide all params

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ArgumentError

Returns a new instance of ArgumentError.



12
13
14
15
16
17
# File 'lib/wise_gopher/errors.rb', line 12

def initialize(params)
  @params = params.map do |name, param|
    param_type = param.respond_to?(:type) ? param.type.type : :raw_param
    "- \"#{name}\" (#{param_type})"
  end.join("\n")
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



10
11
12
# File 'lib/wise_gopher/errors.rb', line 10

def params
  @params
end

Instance Method Details

#messageObject



19
20
21
22
23
24
25
# File 'lib/wise_gopher/errors.rb', line 19

def message
  <<~STR
    \n
    The following params are required but were not provided:
    #{params}
  STR
end