Class: LanguageServer::Protocol::Interface::NotebookCellArrayChange
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookCellArrayChange
- Defined in:
- lib/language_server/protocol/interface/notebook_cell_array_change.rb
Overview
A change describing how to move a ‘NotebookCell` array from state S to S’.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#cells ⇒ NotebookCell[]
The new cells, if any.
-
#delete_count ⇒ number
The deleted cells.
-
#initialize(start:, delete_count:, cells: nil) ⇒ NotebookCellArrayChange
constructor
A new instance of NotebookCellArrayChange.
-
#start ⇒ number
The start offset of the cell that changed.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(start:, delete_count:, cells: nil) ⇒ NotebookCellArrayChange
Returns a new instance of NotebookCellArrayChange.
9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 9 def initialize(start:, delete_count:, cells: nil) @attributes = {} @attributes[:start] = start @attributes[:deleteCount] = delete_count @attributes[:cells] = cells if cells @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
43 44 45 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 43 def attributes @attributes end |
Instance Method Details
#cells ⇒ NotebookCell[]
The new cells, if any
39 40 41 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 39 def cells attributes.fetch(:cells) end |
#delete_count ⇒ number
The deleted cells
31 32 33 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 31 def delete_count attributes.fetch(:deleteCount) end |
#start ⇒ number
The start offset of the cell that changed.
23 24 25 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 23 def start attributes.fetch(:start) end |
#to_hash ⇒ Object
45 46 47 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 45 def to_hash attributes end |
#to_json(*args) ⇒ Object
49 50 51 |
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 49 def to_json(*args) to_hash.to_json(*args) end |