Sha256: a99c4a15fdfc555d491d3cfda8278aba20c1c183199e6f1febee595b47de883c

Contents?: true

Size: 922 Bytes

Versions: 2

Compression:

Stored size: 922 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      class FileSystemWatcher
        def initialize(glob_pattern:, kind: nil)
          @attributes = {}

          @attributes[:globPattern] = glob_pattern
          @attributes[:kind] = kind if kind

          @attributes.freeze
        end

        #
        # The  glob pattern to watch
        #
        # @return [string]
        def glob_pattern
          attributes.fetch(:globPattern)
        end

        #
        # The kind of events of interest. If omitted it defaults
        # to WatchKind.Create | WatchKind.Change | WatchKind.Delete
        # which is 7.
        #
        # @return [number]
        def kind
          attributes.fetch(:kind)
        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

2 entries across 2 versions & 1 rubygems

Version Path
language_server-protocol-3.12.0.0 lib/language_server/protocol/interface/file_system_watcher.rb
language_server-protocol-3.7.0.0 lib/language_server/protocol/interface/file_system_watcher.rb