Class: LanguageServer::Protocol::Interface::NotebookDocumentFilter
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookDocumentFilter
- Defined in:
- lib/language_server/protocol/interface/notebook_document_filter.rb,
sig/language_server/protocol/interface/notebook_document_filter.rbs
Overview
A notebook document filter denotes a notebook document by different properties. The properties will be match against the notebook's URI (same as with documents)
Instance Attribute Summary collapse
- #attributes ⇒ Hash[Symbol, untyped] readonly
Instance Method Summary collapse
-
#initialize(notebook_type: nil, scheme: nil, pattern: nil) ⇒ NotebookDocumentFilter
constructor
A new instance of NotebookDocumentFilter.
-
#notebook_type ⇒ string
The type of the enclosing notebook.
-
#pattern ⇒ string
A glob pattern.
-
#scheme ⇒ string
A Uri Uri.scheme scheme, like
fileoruntitled. - #to_hash ⇒ Hash[Symbol, untyped]
- #to_json(*args) ⇒ String
Constructor Details
#initialize(notebook_type: nil, scheme: nil, pattern: nil) ⇒ NotebookDocumentFilter
Returns a new instance of NotebookDocumentFilter.
12 13 14 15 16 17 18 19 20 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 12 def initialize(notebook_type: nil, scheme: nil, pattern: nil) @attributes = {} @attributes[:notebookType] = notebook_type if notebook_type @attributes[:scheme] = scheme if scheme @attributes[:pattern] = pattern if pattern @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Hash[Symbol, untyped] (readonly)
46 47 48 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 46 def attributes @attributes end |
Instance Method Details
#notebook_type ⇒ string
The type of the enclosing notebook.
26 27 28 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 26 def notebook_type attributes.fetch(:notebookType) end |
#pattern ⇒ string
A glob pattern.
42 43 44 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 42 def pattern attributes.fetch(:pattern) end |
#scheme ⇒ string
A Uri Uri.scheme scheme, like file or untitled.
34 35 36 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 34 def scheme attributes.fetch(:scheme) end |
#to_hash ⇒ Hash[Symbol, untyped]
48 49 50 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 48 def to_hash attributes end |
#to_json(*args) ⇒ String
52 53 54 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 52 def to_json(*args) to_hash.to_json(*args) end |