Class: LanguageServer::Protocol::Interface::NotebookCellArrayChange

Inherits:
Object
  • Object
show all
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’.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start:, delete_count:, cells: nil) ⇒ NotebookCellArrayChange

Returns a new instance of NotebookCellArrayChange.

Since:

  • 3.17.0



11
12
13
14
15
16
17
18
19
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 11

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

#attributesObject (readonly)

Since:

  • 3.17.0



45
46
47
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 45

def attributes
  @attributes
end

Instance Method Details

#cellsNotebookCell[] | nil

The new cells, if any

Returns:

Since:

  • 3.17.0



41
42
43
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 41

def cells
  attributes.fetch(:cells)
end

#delete_countuinteger

The deleted cells

Returns:

  • (uinteger)

Since:

  • 3.17.0



33
34
35
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 33

def delete_count
  attributes.fetch(:deleteCount)
end

#startuinteger

The start oftest of the cell that changed.

Returns:

  • (uinteger)

Since:

  • 3.17.0



25
26
27
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 25

def start
  attributes.fetch(:start)
end

#to_hashObject

Since:

  • 3.17.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



51
52
53
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 51

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