Class: LanguageServer::Protocol::Interface::NotebookCellTextDocumentFilter

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

Overview

A notebook cell text document filter denotes a cell text document by different properties.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook:, language: nil) ⇒ NotebookCellTextDocumentFilter

Returns a new instance of NotebookCellTextDocumentFilter.



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

def initialize(notebook:, language: nil)
  @attributes = {}

  @attributes[:notebook] = notebook
  @attributes[:language] = language if language

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#languagestring

A language id like ‘python`.

Will be matched against the language id of the notebook cell document. ‘*’ matches every language.

Returns:

  • (string)


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

def language
  attributes.fetch(:language)
end

#notebookstring | NotebookDocumentFilter

A filter that matches against the notebook containing the notebook cell. If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.

Returns:



25
26
27
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 25

def notebook
  attributes.fetch(:notebook)
end

#to_hashObject



42
43
44
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 42

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



46
47
48
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 46

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