Class: LanguageServer::Protocol::Interface::NotebookDocument
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookDocument
- Defined in:
- lib/language_server/protocol/interface/notebook_document.rb
Overview
A notebook document.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#cells ⇒ NotebookCell[]
The cells of a notebook.
-
#initialize(uri:, notebook_type:, version:, metadata: nil, cells:) ⇒ NotebookDocument
constructor
A new instance of NotebookDocument.
-
#metadata ⇒ LSPObject
Additional metadata stored with the notebook document.
-
#notebook_type ⇒ string
The type of the notebook.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The notebook document’s URI.
-
#version ⇒ number
The version number of this document (it will increase after each change, including undo/redo).
Constructor Details
#initialize(uri:, notebook_type:, version:, metadata: nil, cells:) ⇒ NotebookDocument
Returns a new instance of NotebookDocument.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 8 def initialize(uri:, notebook_type:, version:, metadata: nil, cells:) @attributes = {} @attributes[:uri] = uri @attributes[:notebookType] = notebook_type @attributes[:version] = version @attributes[:metadata] = if @attributes[:cells] = cells @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
62 63 64 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 62 def attributes @attributes end |
Instance Method Details
#cells ⇒ NotebookCell[]
The cells of a notebook.
58 59 60 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 58 def cells attributes.fetch(:cells) end |
#metadata ⇒ LSPObject
Additional metadata stored with the notebook document.
50 51 52 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 50 def attributes.fetch(:metadata) end |
#notebook_type ⇒ string
The type of the notebook.
32 33 34 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 32 def notebook_type attributes.fetch(:notebookType) end |
#to_hash ⇒ Object
64 65 66 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 64 def to_hash attributes end |
#to_json(*args) ⇒ Object
68 69 70 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 68 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The notebook document’s URI.
24 25 26 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 24 def uri attributes.fetch(:uri) end |
#version ⇒ number
The version number of this document (it will increase after each change, including undo/redo).
41 42 43 |
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 41 def version attributes.fetch(:version) end |