Exception: WiseGopher::ArgumentError
- 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
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ ArgumentError
constructor
A new instance of ArgumentError.
- #message ⇒ Object
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
#params ⇒ Object (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
#message ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/wise_gopher/errors.rb', line 19 def <<~STR \n The following params are required but were not provided: #{params} STR end |