Class: DSP::ModuleEvent

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

Overview

interface ModuleEvent extends Event {

    body: {
        /** The reason for the event. */
        reason: 'new' | 'changed' | 'removed';
        /** The new, changed, or removed module. In case of 'removed' only the module id is used. */
        module: Module;
    };
}

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

#bodyObject

type: {



519
520
521
# File 'lib/dsp/dsp_protocol.rb', line 519

def body
  @body
end

#eventObject

/** The reason for the event. */

    reason: 'new' | 'changed' | 'removed';
    /** The new, changed, or removed module. In case of 'removed' only the module id is used. */
    module: Module;
}


525
526
527
# File 'lib/dsp/dsp_protocol.rb', line 525

def event
  @event
end

#seqObject

type: {



519
520
521
# File 'lib/dsp/dsp_protocol.rb', line 519

def seq
  @seq
end

#typeObject

type: {



519
520
521
# File 'lib/dsp/dsp_protocol.rb', line 519

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



527
528
529
530
531
532
533
534
# File 'lib/dsp/dsp_protocol.rb', line 527

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