Sha256: 280dbba2525e25fa760295eb65373ec0bf3bd0727e5a29b8b25550dd9e66b1bd

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # Delete file operation
      #
      class DeleteFile
        def initialize(kind:, uri:, options: nil, annotation_id: nil)
          @attributes = {}

          @attributes[:kind] = kind
          @attributes[:uri] = uri
          @attributes[:options] = options if options
          @attributes[:annotationId] = annotation_id if annotation_id

          @attributes.freeze
        end

        #
        # A delete
        #
        # @return ["delete"]
        def kind
          attributes.fetch(:kind)
        end

        #
        # The file to delete.
        #
        # @return [string]
        def uri
          attributes.fetch(:uri)
        end

        #
        # Delete options.
        #
        # @return [DeleteFileOptions]
        def options
          attributes.fetch(:options)
        end

        #
        # An optional annotation identifer describing the operation.
        #
        # @return [string]
        def annotation_id
          attributes.fetch(:annotationId)
        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

4 entries across 4 versions & 1 rubygems

Version Path
language_server-protocol-3.16.0.3 lib/language_server/protocol/interface/delete_file.rb
language_server-protocol-3.16.0.2 lib/language_server/protocol/interface/delete_file.rb
language_server-protocol-3.16.0.1 lib/language_server/protocol/interface/delete_file.rb
language_server-protocol-3.16.0.0 lib/language_server/protocol/interface/delete_file.rb