Class: DSP::Message
Overview
interface Message { /** Unique identifier for the message. / id: number; /* A format string for the message. Embedded variables have the form 'name'. If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes. / format: string; /* An object used as a dictionary for looking up the variables in the format string. / variables?: { [key: string]: string; }; /* If true send to telemetry. / sendTelemetry?: boolean; /* If true show user. / showUser?: boolean; /* An optional url where additional information about this message can be found. / url?: string; /* An optional label that is presented to the user as the UI for opening the url. */ urlLabel?: string; }
Instance Attribute Summary collapse
-
#format ⇒ Object
type: number # type: string # type: {.
-
#id ⇒ Object
type: number # type: string # type: {.
-
#sendTelemetry ⇒ Object
[key: string]: string; }.
-
#showUser ⇒ Object
type: number # type: string # type: {.
-
#url ⇒ Object
type: number # type: string # type: {.
-
#urlLabel ⇒ Object
type: number # type: string # type: {.
-
#variables ⇒ Object
type: number # type: string # type: {.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ Message
constructor
A new instance of Message.
Methods inherited from DSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ Message
Returns a new instance of Message.
3747 3748 3749 3750 |
# File 'lib/dsp/dsp_protocol.rb', line 3747 def initialize(initial_hash = nil) super @optional_method_names = %i[variables sendTelemetry showUser url urlLabel] end |
Instance Attribute Details
#format ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def format @format end |
#id ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def id @id end |
#sendTelemetry ⇒ Object
[key: string]: string; }
3745 3746 3747 |
# File 'lib/dsp/dsp_protocol.rb', line 3745 def sendTelemetry @sendTelemetry end |
#showUser ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def showUser @showUser end |
#url ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def url @url end |
#urlLabel ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def urlLabel @urlLabel end |
#variables ⇒ Object
type: number # type: string # type: {
3742 3743 3744 |
# File 'lib/dsp/dsp_protocol.rb', line 3742 def variables @variables end |
Instance Method Details
#from_h!(value) ⇒ Object
3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 |
# File 'lib/dsp/dsp_protocol.rb', line 3752 def from_h!(value) value = {} if value.nil? self.id = value['id'] self.format = value['format'] self.variables = value['variables'] # Unknown type self.sendTelemetry = value['sendTelemetry'] # Unknown type self.showUser = value['showUser'] # Unknown type self.url = value['url'] self.urlLabel = value['urlLabel'] self end |