Exception: PG::URL::Error::InvalidType
- Inherits:
-
StandardError
- Object
- StandardError
- PG::URL::Error::InvalidType
- Defined in:
- lib/pg/url/error.rb
Instance Attribute Summary collapse
-
#invalid ⇒ Object
readonly
Returns the value of attribute invalid.
Instance Method Summary collapse
-
#initialize(invalid = [], message = String.new) ⇒ InvalidType
constructor
A new instance of InvalidType.
Constructor Details
#initialize(invalid = [], message = String.new) ⇒ InvalidType
Returns a new instance of InvalidType.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pg/url/error.rb', line 25 def initialize(invalid = [], = String.new) @invalid = invalid = .empty? ? 'Invalid parameter type(s)' : .build! do |s| lines = [] invalid.each do |param| line = String.build "\n" do |s2| s2 << "#{param[:param]}: " s2 << "Got #{param[:is_a?]}, " s2 << "Expected [#{param[:expected]*', '}]" end lines << line end s << lines*', ' end super() end |
Instance Attribute Details
#invalid ⇒ Object (readonly)
Returns the value of attribute invalid.
24 25 26 |
# File 'lib/pg/url/error.rb', line 24 def invalid @invalid end |