Class: LanguageServer::Protocol::Interface::FileSystemWatcher
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::FileSystemWatcher
- Defined in:
- lib/language_server/protocol/interface/file_system_watcher.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#glob_pattern ⇒ GlobPattern
The glob pattern to watch.
-
#initialize(glob_pattern:, kind: nil) ⇒ FileSystemWatcher
constructor
A new instance of FileSystemWatcher.
-
#kind ⇒ number
The kind of events of interest.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(glob_pattern:, kind: nil) ⇒ FileSystemWatcher
Returns a new instance of FileSystemWatcher.
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
33 34 35 |
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 33 def attributes @attributes end |
Instance Method Details
#glob_pattern ⇒ GlobPattern
The glob pattern to watch. See GlobPattern glob pattern for more detail.
19 20 21 |
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 19 def glob_pattern attributes.fetch(:globPattern) end |
#kind ⇒ number
The kind of events of interest. If omitted it defaults to WatchKind.Create | WatchKind.Change | WatchKind.Delete which is 7.
29 30 31 |
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 29 def kind attributes.fetch(:kind) end |
#to_hash ⇒ Object
35 36 37 |
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 35 def to_hash attributes end |
#to_json(*args) ⇒ Object
39 40 41 |
# File 'lib/language_server/protocol/interface/file_system_watcher.rb', line 39 def to_json(*args) to_hash.to_json(*args) end |