Class: LanguageServer::Protocol::Interface::NotebookCellTextDocumentFilter
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookCellTextDocumentFilter
- 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
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(notebook:, language: nil) ⇒ NotebookCellTextDocumentFilter
constructor
A new instance of NotebookCellTextDocumentFilter.
-
#language ⇒ string
A language id like ‘python`.
-
#notebook ⇒ string | NotebookDocumentFilter
A filter that matches against the notebook containing the notebook cell.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
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
#attributes ⇒ Object (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
#language ⇒ string
A language id like ‘python`.
Will be matched against the language id of the notebook cell document. ‘*’ matches every language.
36 37 38 |
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 36 def language attributes.fetch(:language) end |
#notebook ⇒ string | 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.
25 26 27 |
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 25 def notebook attributes.fetch(:notebook) end |
#to_hash ⇒ Object
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 |