Sha256: 7ef3abff52011112a65032ea1e921c1bcb99f2fab1352976f0e1e7785b1c78a1

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # An event describing a file change.
      #
      class FileEvent
        def initialize(uri:, type:)
          @attributes = {}

          @attributes[:uri] = uri
          @attributes[:type] = type

          @attributes.freeze
        end

        #
        # The file's URI.
        #
        # @return [string]
        def uri
          attributes.fetch(:uri)
        end

        #
        # The change type.
        #
        # @return [number]
        def type
          attributes.fetch(:type)
        end

        attr_reader :attributes

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
language_server-protocol-0.4.0 lib/language_server/protocol/interface/file_event.rb
language_server-protocol-0.3.0 lib/language_server/protocol/interface/file_event.rb