Class: LSP::Registration

Inherits:
LSPBase show all
Defined in:
lib/lsp/lsp_protocol.rb

Overview

export interface Registration

/**
 * The id used to register the request. The id can be used to deregister
 * the request again.
 */
id: string;
/**
 * The method to register for.
 */
method: string;
/**
 * Options necessary for the registration.
 */
registerOptions?: any;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ Registration

Returns a new instance of Registration.



29
30
31
32
# File 'lib/lsp/lsp_protocol.rb', line 29

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[registerOptions]
end

Instance Attribute Details

#idObject

type: string # type: string # type: any



27
28
29
# File 'lib/lsp/lsp_protocol.rb', line 27

def id
  @id
end

#method__lspObject

type: string # type: string # type: any



27
28
29
# File 'lib/lsp/lsp_protocol.rb', line 27

def method__lsp
  @method__lsp
end

#registerOptionsObject

type: string # type: string # type: any



27
28
29
# File 'lib/lsp/lsp_protocol.rb', line 27

def registerOptions
  @registerOptions
end

Instance Method Details

#from_h!(value) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/lsp/lsp_protocol.rb', line 34

def from_h!(value)
  value = {} if value.nil?
  self.id = value['id']
  self.method__lsp = value['method']
  self.registerOptions = value['registerOptions']
  self
end