Class: LanguageServer::Protocol::Interface::DidOpenNotebookDocumentParams

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

Overview

The params sent in an open notebook document notification.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook_document:, cell_text_documents:) ⇒ DidOpenNotebookDocumentParams

Returns a new instance of DidOpenNotebookDocumentParams.

Since:

  • 3.17.0



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

def initialize(notebook_document:, cell_text_documents:)
  @attributes = {}

  @attributes[:notebookDocument] = notebook_document
  @attributes[:cellTextDocuments] = cell_text_documents

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



36
37
38
# File 'lib/language_server/protocol/interface/did_open_notebook_document_params.rb', line 36

def attributes
  @attributes
end

Instance Method Details

#cell_text_documentsTextDocumentItem[]

The text documents that represent the content of a notebook cell.

Returns:

Since:

  • 3.17.0



32
33
34
# File 'lib/language_server/protocol/interface/did_open_notebook_document_params.rb', line 32

def cell_text_documents
  attributes.fetch(:cellTextDocuments)
end

#notebook_documentNotebookDocument

The notebook document that got opened.

Returns:

Since:

  • 3.17.0



23
24
25
# File 'lib/language_server/protocol/interface/did_open_notebook_document_params.rb', line 23

def notebook_document
  attributes.fetch(:notebookDocument)
end

#to_hashObject

Since:

  • 3.17.0



38
39
40
# File 'lib/language_server/protocol/interface/did_open_notebook_document_params.rb', line 38

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



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

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