Class: LanguageServer::Protocol::Interface::NotebookDocumentFilter
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookDocumentFilter
- Defined in:
- lib/language_server/protocol/interface/notebook_document_filter.rb
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 ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(notebook_type:, scheme: nil, pattern: nil) ⇒ NotebookDocumentFilter
constructor
A new instance of NotebookDocumentFilter.
-
#notebook_type ⇒ string
The type of the enclosing notebook.
-
#pattern ⇒ string | nil
A glob pattern.
-
#scheme ⇒ string | nil
A Uri [scheme](#Uri.scheme), like
fileoruntitled. - #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(notebook_type:, 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:, scheme: nil, pattern: nil) @attributes = {} @attributes[:notebookType] = notebook_type @attributes[:scheme] = scheme if scheme @attributes[:pattern] = pattern if pattern @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (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 | nil
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 | nil
A Uri [scheme](#Uri.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 ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 48 def to_hash attributes end |
#to_json(*args) ⇒ Object
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 |