Exception: Sendle::Api::Errors::UnprocessableEntity

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sendle/api/errors/unprocessable_entity.rb

Instance Method Summary collapse

Constructor Details

#initialize(messages) ⇒ UnprocessableEntity

Returns a new instance of UnprocessableEntity.



6
7
8
# File 'lib/sendle/api/errors/unprocessable_entity.rb', line 6

def initialize(messages)
  @messages = messages
end

Instance Method Details

#to_sObject



10
11
12
13
14
# File 'lib/sendle/api/errors/unprocessable_entity.rb', line 10

def to_s
  msg = "Please fix the following errors and try again - "
  @messages.each { |k, v| msg += "#{k}: #{v.join(', ')}" }
  msg
end