Class: DSP::Event
Overview
interface Event extends ProtocolMessage {
/** Type of event. */
event: string;
/** Event-specific information. */
body?: any;
}
Instance Attribute Summary collapse
-
#body ⇒ Object
type: string # type: any # type: number # type: string.
-
#event ⇒ Object
type: string # type: any # type: number # type: string.
-
#seq ⇒ Object
type: string # type: any # type: number # type: string.
-
#type ⇒ Object
type: string # type: any # type: number # type: string.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ Event
constructor
A new instance of Event.
Methods inherited from DSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ Event
Returns a new instance of Event.
64 65 66 67 |
# File 'lib/dsp/dsp_protocol.rb', line 64 def initialize(initial_hash = nil) super @optional_method_names = %i[body] end |
Instance Attribute Details
#body ⇒ Object
type: string # type: any # type: number # type: string
62 63 64 |
# File 'lib/dsp/dsp_protocol.rb', line 62 def body @body end |
#event ⇒ Object
type: string # type: any # type: number # type: string
62 63 64 |
# File 'lib/dsp/dsp_protocol.rb', line 62 def event @event end |
#seq ⇒ Object
type: string # type: any # type: number # type: string
62 63 64 |
# File 'lib/dsp/dsp_protocol.rb', line 62 def seq @seq end |
#type ⇒ Object
type: string # type: any # type: number # type: string
62 63 64 |
# File 'lib/dsp/dsp_protocol.rb', line 62 def type @type end |
Instance Method Details
#from_h!(value) ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/dsp/dsp_protocol.rb', line 69 def from_h!(value) value = {} if value.nil? self.event = value['event'] self.body = value['body'] self.seq = value['seq'] self.type = value['type'] self end |