Class: LanguageServer::Protocol::Interface::NotebookDocumentFilter

Inherits:
Object
  • Object
show all
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)

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook_type: nil, scheme: nil, pattern: nil) ⇒ NotebookDocumentFilter

Returns a new instance of NotebookDocumentFilter.

Parameters:

  • notebook_type: (String) (defaults to: nil)
  • scheme: (String) (defaults to: nil)
  • pattern: (String) (defaults to: nil)

Since:

  • 3.17.0



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

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



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

def attributes
  @attributes
end

Instance Method Details

#notebook_typestring

The type of the enclosing notebook.

Returns:

  • (string)

Since:

  • 3.17.0



26
27
28
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 26

def notebook_type
  attributes.fetch(:notebookType)
end

#patternstring

A glob pattern.

Returns:

  • (string)

Since:

  • 3.17.0



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

def pattern
  attributes.fetch(:pattern)
end

#schemestring

A Uri Uri.scheme scheme, like file or untitled.

Returns:

  • (string)

Since:

  • 3.17.0



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

def scheme
  attributes.fetch(:scheme)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



48
49
50
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 48

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.17.0



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