Class: DSP::LoadedSourceEvent

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

Overview

interface LoadedSourceEvent extends Event {

    body: {
        /** The reason for the event. */
        reason: 'new' | 'changed' | 'removed';
        /** The new, changed, or removed source. */
        source: Source;
    };
}

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: {



546
547
548
# File 'lib/dsp/dsp_protocol.rb', line 546

def body
  @body
end

#eventObject

/** The reason for the event. */

    reason: 'new' | 'changed' | 'removed';
    /** The new, changed, or removed source. */
    source: Source;
}


552
553
554
# File 'lib/dsp/dsp_protocol.rb', line 552

def event
  @event
end

#seqObject

type: {



546
547
548
# File 'lib/dsp/dsp_protocol.rb', line 546

def seq
  @seq
end

#typeObject

type: {



546
547
548
# File 'lib/dsp/dsp_protocol.rb', line 546

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



554
555
556
557
558
559
560
561
# File 'lib/dsp/dsp_protocol.rb', line 554

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