class JSend::ErrorMessageParser

Public Class Methods

response_from_hash(hash) click to toggle source
# File lib/jsend/parser/error_message_parser.rb, line 8
def self.response_from_hash(hash)
  raise InvalidData if hash['message'].nil?
  raise InvalidData if HashUtils.has_fields_different_from(hash, %w(status message code data))

  ErrorResponse.new hash['data'],hash['message'],hash['code']
end