Class: LanguageServer::Protocol::Interface::FileSystemWatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/file_system_watcher.rb,
sig/language_server/protocol/interface/file_system_watcher.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(glob_pattern:, kind: nil) ⇒ FileSystemWatcher

Returns a new instance of FileSystemWatcher.

Parameters:

  • glob_pattern: (Object)
  • kind: (Object) (defaults to: nil)


5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 5

def initialize(glob_pattern:, kind: nil)
  @attributes = {}

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

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


34
35
36
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 34

def attributes
  @attributes
end

Instance Method Details

#glob_patternGlobPattern

The glob pattern to watch. See GlobPattern glob pattern for more detail.

Returns:

  • (GlobPattern)

Since:

  • 3.17.0 support for relative patterns.



20
21
22
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 20

def glob_pattern
  attributes.fetch(:globPattern)
end

#kindWatchKind

The kind of events of interest. If omitted it defaults to WatchKind.Create | WatchKind.Change | WatchKind.Delete which is 7.

Returns:

  • (WatchKind)


30
31
32
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 30

def kind
  attributes.fetch(:kind)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


36
37
38
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 36

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


40
41
42
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 40

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