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’.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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

#cellsNotebookCell[]

The new cells, if any

Returns:



39
40
41
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 39

def cells
  attributes.fetch(:cells)
end

#delete_countnumber

The deleted cells

Returns:

  • (number)


31
32
33
# File 'lib/language_server/protocol/interface/notebook_cell_array_change.rb', line 31

def delete_count
  attributes.fetch(:deleteCount)
end

#startnumber

The start offset of the cell that changed.

Returns:

  • (number)


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

def start
  attributes.fetch(:start)
end

#to_hashObject



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