Class: LanguageServer::Protocol::Interface::MonikerRegistrationOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, work_done_progress: nil) ⇒ MonikerRegistrationOptions

Returns a new instance of MonikerRegistrationOptions.

Parameters:

  • document_selector: (Object)
  • work_done_progress: (Boolean) (defaults to: nil)


5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/moniker_registration_options.rb', line 5

def initialize(document_selector:, work_done_progress: nil)
  @attributes = {}

  @attributes[:documentSelector] = document_selector
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


28
29
30
# File 'lib/language_server/protocol/interface/moniker_registration_options.rb', line 28

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | nil

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Returns:

  • (DocumentSelector | nil)


19
20
21
# File 'lib/language_server/protocol/interface/moniker_registration_options.rb', line 19

def document_selector
  attributes.fetch(:documentSelector)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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

#work_done_progressboolean

Returns:

  • (boolean)


24
25
26
# File 'lib/language_server/protocol/interface/moniker_registration_options.rb', line 24

def work_done_progress
  attributes.fetch(:workDoneProgress)
end