Class: DSP::ProtocolMessage

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

Overview

interface ProtocolMessage {

    /** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. */
    seq: number;
    /** Message type.
        Values: 'request', 'response', 'event', etc.
    */
    type: string;
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#initialize, #to_h, #to_json

Constructor Details

This class inherits a constructor from DSP::DSPBase

Instance Attribute Details

#seqObject

type: number # type: string



21
22
23
# File 'lib/dsp/dsp_protocol.rb', line 21

def seq
  @seq
end

#typeObject

type: number # type: string



21
22
23
# File 'lib/dsp/dsp_protocol.rb', line 21

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



23
24
25
26
27
28
# File 'lib/dsp/dsp_protocol.rb', line 23

def from_h!(value)
  value = {} if value.nil?
  self.seq = value['seq']
  self.type = value['type']
  self
end