Class: PuppetEditorServices::Protocol::DebugAdapterMessages::Response
- Inherits:
-
ProtocolMessage
- Object
- ProtocolMessage
- PuppetEditorServices::Protocol::DebugAdapterMessages::Response
- Defined in:
- lib/puppet_editor_services/protocol/debug_adapter_messages.rb
Overview
interface Response extends ProtocolMessage {
/** Sequence number of the corresponding request. */
request_seq: number;
/** Outcome of the request. */
success: boolean;
/** The command requested. */
command: string;
/** Contains error message if success == false. */
: string;
/** Contains request result if success is true and optional error details if success is false. */
body?: any;
}
Instance Attribute Summary collapse
-
#body ⇒ Object
type: number # type: boolean # type: string # type: string # type: any.
-
#command ⇒ Object
type: number # type: boolean # type: string # type: string # type: any.
-
#message ⇒ Object
type: number # type: boolean # type: string # type: string # type: any.
-
#request_seq ⇒ Object
type: number # type: boolean # type: string # type: string # type: any.
-
#success ⇒ Object
type: number # type: boolean # type: string # type: string # type: any.
Attributes inherited from ProtocolMessage
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
Methods inherited from ProtocolMessage
Constructor Details
#initialize(initial_hash = nil) ⇒ Response
Returns a new instance of Response.
116 117 118 119 120 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 116 def initialize(initial_hash = nil) super from_h!(initial_hash) unless initial_hash.nil? self.type = 'response' end |
Instance Attribute Details
#body ⇒ Object
type: number # type: boolean # type: string # type: string # type: any
114 115 116 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 114 def body @body end |
#command ⇒ Object
type: number # type: boolean # type: string # type: string # type: any
114 115 116 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 114 def command @command end |
#message ⇒ Object
type: number # type: boolean # type: string # type: string # type: any
114 115 116 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 114 def end |
#request_seq ⇒ Object
type: number # type: boolean # type: string # type: string # type: any
114 115 116 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 114 def request_seq @request_seq end |
#success ⇒ Object
type: number # type: boolean # type: string # type: string # type: any
114 115 116 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 114 def success @success end |
Instance Method Details
#from_h!(value) ⇒ Object
122 123 124 125 126 127 128 129 130 131 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 122 def from_h!(value) value = {} if value.nil? super self.request_seq = value['request_seq'] self.success = value['success'] self.command = value['command'] self. = value['message'] self.body = value['body'] self end |
#to_h ⇒ Object
133 134 135 136 137 138 139 140 141 |
# File 'lib/puppet_editor_services/protocol/debug_adapter_messages.rb', line 133 def to_h super.tap do |hash| hash['request_seq'] = request_seq hash['success'] = success hash['command'] = command hash['message'] = unless .nil? hash['body'] = body unless body.nil? end end |