Class: LanguageServer::Protocol::Interface::Registration
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::Registration
- Defined in:
- lib/language_server/protocol/interface/registration.rb
Overview
General parameters to register for a capability.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#id ⇒ string
The id used to register the request.
-
#initialize(id:, method:, register_options: nil) ⇒ Registration
constructor
A new instance of Registration.
-
#method ⇒ string
The method / capability to register for.
-
#register_options ⇒ LSPAny
Options necessary for the registration.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(id:, method:, register_options: nil) ⇒ Registration
Returns a new instance of Registration.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/registration.rb', line 8 def initialize(id:, method:, register_options: nil) @attributes = {} @attributes[:id] = id @attributes[:method] = method @attributes[:registerOptions] = if @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
43 44 45 |
# File 'lib/language_server/protocol/interface/registration.rb', line 43 def attributes @attributes end |
Instance Method Details
#id ⇒ string
The id used to register the request. The id can be used to deregister the request again.
23 24 25 |
# File 'lib/language_server/protocol/interface/registration.rb', line 23 def id attributes.fetch(:id) end |
#method ⇒ string
The method / capability to register for.
31 32 33 |
# File 'lib/language_server/protocol/interface/registration.rb', line 31 def method attributes.fetch(:method) end |
#register_options ⇒ LSPAny
Options necessary for the registration.
39 40 41 |
# File 'lib/language_server/protocol/interface/registration.rb', line 39 def attributes.fetch(:registerOptions) end |
#to_hash ⇒ Object
45 46 47 |
# File 'lib/language_server/protocol/interface/registration.rb', line 45 def to_hash attributes end |
#to_json(*args) ⇒ Object
49 50 51 |
# File 'lib/language_server/protocol/interface/registration.rb', line 49 def to_json(*args) to_hash.to_json(*args) end |