Class: DSP::ErrorResponse

Inherits:
DSPBase
  • Object
show all
Defined in:
lib/dsp/dsp_protocol.rb

Overview

interface ErrorResponse extends Response {

    body: {
        /** An optional, structured error message. */
        error?: Message;
    };
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



134
135
136
137
# File 'lib/dsp/dsp_protocol.rb', line 134

def initialize(initial_hash = nil)
  super
  @optional_method_names = i[message]
end

Instance Attribute Details

#bodyObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def body
  @body
end

#commandObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def command
  @command
end

#messageObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def message
  @message
end

#request_seqObject

/** An optional, structured error message. */

    error?: Message;
}


132
133
134
# File 'lib/dsp/dsp_protocol.rb', line 132

def request_seq
  @request_seq
end

#seqObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def seq
  @seq
end

#successObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def success
  @success
end

#typeObject

type: {



128
129
130
# File 'lib/dsp/dsp_protocol.rb', line 128

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/dsp/dsp_protocol.rb', line 139

def from_h!(value)
  value = {} if value.nil?
  self.body = value['body'] # Unknown type
  self.request_seq = value['request_seq']
  self.success = value['success'] # Unknown type
  self.command = value['command']
  self.message = value['message']
  self.seq = value['seq']
  self.type = value['type']
  self
end