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

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

Overview

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

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.



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

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

#attributesObject (readonly)

Returns the value of attribute attributes.



67
68
69
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 67

def attributes
  @attributes
end

Instance Method Details

#notebook_typestring

The type of the enclosing notebook.

— OR —

The type of the enclosing notebook.

— OR —

The type of the enclosing notebook.

Returns:

  • (string)


31
32
33
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 31

def notebook_type
  attributes.fetch(:notebookType)
end

#patternstring

A glob pattern.

— OR —

A glob pattern.

— OR —

A glob pattern.

Returns:

  • (string)


63
64
65
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 63

def pattern
  attributes.fetch(:pattern)
end

#schemestring

A Uri [scheme](#Uri.scheme), like ‘file` or `untitled`.

— OR —

A Uri [scheme](#Uri.scheme), like ‘file` or `untitled`.

— OR —

A Uri [scheme](#Uri.scheme), like ‘file` or `untitled`.

Returns:

  • (string)


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

def scheme
  attributes.fetch(:scheme)
end

#to_hashObject



69
70
71
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 69

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



73
74
75
# File 'lib/language_server/protocol/interface/notebook_document_filter.rb', line 73

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