Class: PuppetEditorServices::Protocol::DebugAdapterMessages::Event
- Inherits:
-
ProtocolMessage
- Object
- ProtocolMessage
- PuppetEditorServices::Protocol::DebugAdapterMessages::Event
- Defined in:
- lib/puppet_editor_services/protocol/debug_adapter_messages.rb
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.
-
#event ⇒ Object
type: string # type: any.
Attributes inherited from ProtocolMessage
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Methods inherited from ProtocolMessage
Constructor Details
#initialize(initial_hash = nil) ⇒ Event
Returns a new instance of Event.
80 81 82 83 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 80 def initialize(initial_hash = nil) super self.type = 'event' end |
Instance Attribute Details
#body ⇒ Object
type: string # type: any
78 79 80 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 78 def body @body end |
#event ⇒ Object
type: string # type: any
78 79 80 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 78 def event @event end |
Instance Method Details
#from_h!(value) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 85 def from_h!(value) value = {} if value.nil? super self.event = value['event'] self.body = value['body'] self end |
#to_h ⇒ Object
93 94 95 96 97 98 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 93 def to_h super.tap do |hash| hash['event'] = event hash['body'] = body unless body.nil? end end |