Class: PuppetEditorServices::Protocol::DebugAdapterMessages::Event

Inherits:
ProtocolMessage
  • Object
show all
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

Attributes inherited from ProtocolMessage

#seq, #type

Instance Method Summary collapse

Methods inherited from ProtocolMessage

#to_json

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

#bodyObject

type: string # type: any



78
79
80
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 78

def body
  @body
end

#eventObject

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_hObject



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