Class: LanguageServer::Protocol::Interface::GlobPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/glob_pattern.rb

Overview

The glob pattern. Either a string pattern or a relative pattern.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_uri:, pattern:) ⇒ GlobPattern

Returns a new instance of GlobPattern.

Since:

  • 3.17.0



10
11
12
13
14
15
16
17
# File 'lib/language_server/protocol/interface/glob_pattern.rb', line 10

def initialize(base_uri:, pattern:)
  @attributes = {}

  @attributes[:baseUri] = base_uri
  @attributes[:pattern] = pattern

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



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

def attributes
  @attributes
end

Instance Method Details

#base_uriWorkspaceFolder | URI

A workspace folder or a base URI to which this pattern will be matched against relatively.

Returns:

Since:

  • 3.17.0



24
25
26
# File 'lib/language_server/protocol/interface/glob_pattern.rb', line 24

def base_uri
  attributes.fetch(:baseUri)
end

#patternPattern

The actual glob pattern;

Returns:

  • (Pattern)

Since:

  • 3.17.0



32
33
34
# File 'lib/language_server/protocol/interface/glob_pattern.rb', line 32

def pattern
  attributes.fetch(:pattern)
end

#to_hashObject

Since:

  • 3.17.0



38
39
40
# File 'lib/language_server/protocol/interface/glob_pattern.rb', line 38

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



42
43
44
# File 'lib/language_server/protocol/interface/glob_pattern.rb', line 42

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