Class: LanguageServer::Protocol::Interface::NotebookCell
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookCell
- Defined in:
- lib/language_server/protocol/interface/notebook_cell.rb
Overview
A notebook cell.
A cell’s document URI must be unique across ALL notebook cells and can therefore be used to uniquely identify a notebook cell or the cell’s text document.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#document ⇒ string
The URI of the cell’s text document content.
-
#execution_summary ⇒ ExecutionSummary
Additional execution summary information if supported by the client.
-
#initialize(kind:, document:, metadata: nil, execution_summary: nil) ⇒ NotebookCell
constructor
A new instance of NotebookCell.
-
#kind ⇒ any
The cell’s kind.
-
#metadata ⇒ LSPObject
Additional metadata stored with the cell.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(kind:, document:, metadata: nil, execution_summary: nil) ⇒ NotebookCell
Returns a new instance of NotebookCell.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 12 def initialize(kind:, document:, metadata: nil, execution_summary: nil) @attributes = {} @attributes[:kind] = kind @attributes[:document] = document @attributes[:metadata] = if @attributes[:executionSummary] = execution_summary if execution_summary @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
57 58 59 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 57 def attributes @attributes end |
Instance Method Details
#document ⇒ string
The URI of the cell’s text document content.
36 37 38 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 36 def document attributes.fetch(:document) end |
#execution_summary ⇒ ExecutionSummary
Additional execution summary information if supported by the client.
53 54 55 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 53 def execution_summary attributes.fetch(:executionSummary) end |
#kind ⇒ any
The cell’s kind
27 28 29 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 27 def kind attributes.fetch(:kind) end |
#metadata ⇒ LSPObject
Additional metadata stored with the cell.
44 45 46 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 44 def attributes.fetch(:metadata) end |
#to_hash ⇒ Object
59 60 61 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 59 def to_hash attributes end |
#to_json(*args) ⇒ Object
63 64 65 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 63 def to_json(*args) to_hash.to_json(*args) end |