Class: PuppetEditorServices::Protocol::DebugAdapterMessages::ProtocolMessage
- Inherits:
-
Object
- Object
- PuppetEditorServices::Protocol::DebugAdapterMessages::ProtocolMessage
- Defined in:
- lib/puppet_editor_services/protocol/debug_adapter_messages.rb
Overview
Protocol message primitives interface ProtocolMessage {
/** Sequence number. */
seq: number;
/** Message type.
Values: 'request', 'response', 'event', etc.
*/
type: string;
}
Instance Attribute Summary collapse
-
#seq ⇒ Object
type: number # type: string.
-
#type ⇒ Object
type: number # type: string.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ ProtocolMessage
constructor
A new instance of ProtocolMessage.
- #to_h ⇒ Object
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(initial_hash = nil) ⇒ ProtocolMessage
Returns a new instance of ProtocolMessage.
18 19 20 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 18 def initialize(initial_hash = nil) from_h!(initial_hash) end |
Instance Attribute Details
#seq ⇒ Object
type: number # type: string
16 17 18 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 16 def seq @seq end |
#type ⇒ Object
type: number # type: string
16 17 18 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 16 def type @type end |
Instance Method Details
#from_h!(value) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 33 def from_h!(value) value = {} if value.nil? self.seq = value['seq'] self.type = value['type'] self end |
#to_h ⇒ Object
26 27 28 29 30 31 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 26 def to_h { 'seq' => seq, 'type' => type } end |
#to_json(*options) ⇒ Object
22 23 24 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 22 def to_json(*) to_h.to_json() end |