Class: LanguageServer::Protocol::Interfaces::RequestMessage
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interfaces::RequestMessage
- Defined in:
- lib/language_server/protocol/interfaces/request_message.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#id ⇒ string | number
The request id.
-
#initialize(id:, method:, params: nil) ⇒ RequestMessage
constructor
A new instance of RequestMessage.
-
#method ⇒ string
The method to be invoked.
-
#params ⇒ any
The method’s params.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(id:, method:, params: nil) ⇒ RequestMessage
Returns a new instance of RequestMessage.
5 6 7 8 9 10 11 12 13 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 5 def initialize(id:, method:, params: nil) @attributes = {} @attributes[:id] = id @attributes[:method] = method @attributes[:params] = params if params @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
39 40 41 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 39 def attributes @attributes end |
Instance Method Details
#id ⇒ string | number
The request id.
19 20 21 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 19 def id attributes.fetch(:id) end |
#method ⇒ string
The method to be invoked.
27 28 29 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 27 def method attributes.fetch(:method) end |
#params ⇒ any
The method’s params.
35 36 37 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 35 def params attributes.fetch(:params) end |
#to_json(*args) ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interfaces/request_message.rb', line 41 def to_json(*args) attributes.to_json(*args) end |