Class: LanguageServer::Protocol::Interface::WorkspaceFolder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, name:) ⇒ WorkspaceFolder

Returns a new instance of WorkspaceFolder.



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

def initialize(uri:, name:)
  @attributes = {}

  @attributes[:uri] = uri
  @attributes[:name] = name

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



31
32
33
# File 'lib/language_server/protocol/interface/workspace_folder.rb', line 31

def attributes
  @attributes
end

Instance Method Details

#namestring

The name of the workspace folder. Used to refer to this workspace folder in the user interface.

Returns:

  • (string)


27
28
29
# File 'lib/language_server/protocol/interface/workspace_folder.rb', line 27

def name
  attributes.fetch(:name)
end

#to_hashObject



33
34
35
# File 'lib/language_server/protocol/interface/workspace_folder.rb', line 33

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



37
38
39
# File 'lib/language_server/protocol/interface/workspace_folder.rb', line 37

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

#uristring

The associated URI for this workspace folder.

Returns:

  • (string)


18
19
20
# File 'lib/language_server/protocol/interface/workspace_folder.rb', line 18

def uri
  attributes.fetch(:uri)
end