Class: LanguageServer::Protocol::Interface::Unregistration

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/unregistration.rb

Overview

General parameters to unregister a capability.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, method:) ⇒ Unregistration

Returns a new instance of Unregistration.



8
9
10
11
12
13
14
15
# File 'lib/language_server/protocol/interface/unregistration.rb', line 8

def initialize(id:, method:)
  @attributes = {}

  @attributes[:id] = id
  @attributes[:method] = method

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



34
35
36
# File 'lib/language_server/protocol/interface/unregistration.rb', line 34

def attributes
  @attributes
end

Instance Method Details

#idstring

The id used to unregister the request or notification. Usually an id provided during the register request.

Returns:

  • (string)


22
23
24
# File 'lib/language_server/protocol/interface/unregistration.rb', line 22

def id
  attributes.fetch(:id)
end

#methodstring

The method / capability to unregister for.

Returns:

  • (string)


30
31
32
# File 'lib/language_server/protocol/interface/unregistration.rb', line 30

def method
  attributes.fetch(:method)
end

#to_hashObject



36
37
38
# File 'lib/language_server/protocol/interface/unregistration.rb', line 36

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



40
41
42
# File 'lib/language_server/protocol/interface/unregistration.rb', line 40

def to_json(*args)
  to_hash.to_json(*args)
end