Class: PuppetEditorServices::Protocol::JsonRPCMessages::RequestMessage
- Inherits:
-
Message
- Object
- Message
- PuppetEditorServices::Protocol::JsonRPCMessages::RequestMessage
- Defined in:
- lib/puppet_editor_services/protocol/json_rpc_messages.rb
Overview
interface RequestMessage extends Message
/**
* The request id.
*/
id: number | string;
/**
* The method to be invoked.
*/
method: string;
/**
* The method's params.
*/
params?: Array<any> | object;
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#params ⇒ Object
Returns the value of attribute params.
-
#rpc_method ⇒ Object
Returns the value of attribute rpc_method.
Attributes inherited from Message
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ RequestMessage
constructor
A new instance of RequestMessage.
- #to_h ⇒ Object
Methods inherited from Message
Constructor Details
#initialize(initial_hash = nil) ⇒ RequestMessage
Returns a new instance of RequestMessage.
55 56 57 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 55 def initialize(initial_hash = nil) super end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
53 54 55 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 53 def id @id end |
#params ⇒ Object
Returns the value of attribute params.
53 54 55 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 53 def params @params end |
#rpc_method ⇒ Object
Returns the value of attribute rpc_method.
53 54 55 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 53 def rpc_method @rpc_method end |
Instance Method Details
#from_h!(value) ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 59 def from_h!(value) value = {} if value.nil? super self.id = value['id'] self.rpc_method = value['method'] self.params = value['params'] self end |
#to_h ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/puppet_editor_services/protocol/json_rpc_messages.rb', line 68 def to_h super.merge( 'id' => id, 'method' => rpc_method, 'params' => params ) end |