class Freddy::ErrorResponse
Constants
- DEFAULT_ERROR_MESSAGE
Attributes
Public Class Methods
Source
# File lib/freddy/error_response.rb, line 9 def initialize(response) @response = response super(format_message(response) || DEFAULT_ERROR_MESSAGE) end
Calls superclass method
Private Instance Methods
Source
# File lib/freddy/error_response.rb, line 16 def format_message(response) return unless response.is_a?(Hash) message = [response[:error], response[:message]].compact.join(': ') message.empty? ? nil : message end