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

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

Overview

General parameters to unregister a request or notification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, method:) ⇒ Unregistration

Returns a new instance of Unregistration.

Parameters:

  • id: (String)
  • method: (String)


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

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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 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_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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