Sha256: 0c1f08e82729e7765f9008756f38df6dbfee74bd693e87ee5420e4c1275a3a49

Contents?: true

Size: 1.1 KB

Versions: 104

Compression:

Stored size: 1.1 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # A change describing how to move a `NotebookCell`
      # array from state S to S'.
      #
      class NotebookCellArrayChange
        def initialize(start:, delete_count:, cells: nil)
          @attributes = {}

          @attributes[:start] = start
          @attributes[:deleteCount] = delete_count
          @attributes[:cells] = cells if cells

          @attributes.freeze
        end

        #
        # The start offset of the cell that changed.
        #
        # @return [number]
        def start
          attributes.fetch(:start)
        end

        #
        # The deleted cells
        #
        # @return [number]
        def delete_count
          attributes.fetch(:deleteCount)
        end

        #
        # The new cells, if any
        #
        # @return [NotebookCell[]]
        def cells
          attributes.fetch(:cells)
        end

        attr_reader :attributes

        def to_hash
          attributes
        end

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

Version data entries

104 entries across 104 versions & 13 rubygems

Version Path
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/notebook_cell_array_change.rb
language_server-protocol-3.17.0.3 lib/language_server/protocol/interface/notebook_cell_array_change.rb
language_server-protocol-3.17.0.2 lib/language_server/protocol/interface/notebook_cell_array_change.rb
language_server-protocol-3.17.0.1 lib/language_server/protocol/interface/notebook_cell_array_change.rb