Exception: PG::URL::Error::MissingParams

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pg/url/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = [], message = String.new) ⇒ MissingParams

Returns a new instance of MissingParams.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pg/url/error.rb', line 8

def initialize(params = [], message = String.new)
  @params = params
  case params.length
  when 1
    message = message.empty? ? 'Missing required connection string parameter' : message
    super("#{message}: #{params.first}")
  else
    message = message.empty? ? 'Missing required connection string parameters' : message
    super("#{message}: [#{params*', '}].")
  end
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/pg/url/error.rb', line 7

def params
  @params
end