Sha256: e33c4efe9f6328a7a0e634e95f14f93646f25966a613b2f6ee0b924f92fad3cf

Contents?: true

Size: 407 Bytes

Versions: 3

Compression:

Stored size: 407 Bytes

Contents

module Direct::API::V5
  class Response::Error
    attr_reader :code
    attr_reader :message
    attr_reader :details

    def initialize(error_data = {})
      @code = error_data[:error_code]
      @message = error_data[:error_string]
      @details = error_data[:error_detail]
    end

    def to_h
      {
        code: code,
        message: message,
        details: details
      }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
direct-api-v5-0.1.2 lib/direct/api/v5/response/error.rb
direct-api-v5-0.1.1 lib/direct/api/v5/response/error.rb
direct-api-v5-0.1.0 lib/direct/api/v5/response/error.rb