Class: PuppetEditorServices::Protocol::DebugAdapterMessages::Request

Inherits:
ProtocolMessage
  • Object
show all
Defined in:
lib/puppet_editor_services/protocol/debug_adapter_messages.rb

Overview

interface Request extends ProtocolMessage {

    /** The command to execute. */
    command: string;
    /** Object containing arguments for the command. */
    arguments?: 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) ⇒ Request

Returns a new instance of Request.



50
51
52
53
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 50

def initialize(initial_hash = nil)
  super
  self.type = 'request'
end

Instance Attribute Details

#argumentsObject

type: string # type: any



48
49
50
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 48

def arguments
  @arguments
end

#commandObject

type: string # type: any



48
49
50
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 48

def command
  @command
end

Instance Method Details

#from_h!(value) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 55

def from_h!(value)
  value = {} if value.nil?
  super
  self.command = value['command']
  self.arguments = value['arguments']
  self
end

#to_hObject



63
64
65
66
67
68
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 63

def to_h
  super.tap do |hash|
    hash['command'] = command
    hash['arguments'] = arguments unless arguments.nil?
  end
end