Class: LanguageServer::Protocol::Interface::CreateFile

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

Overview

Create file operation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, uri:, options: nil) ⇒ CreateFile

Returns a new instance of CreateFile.



8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/create_file.rb', line 8

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

  @attributes[:kind] = kind
  @attributes[:uri] = uri
  @attributes[:options] = options if options

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#kind"create"

A create

Returns:

  • ("create")


22
23
24
# File 'lib/language_server/protocol/interface/create_file.rb', line 22

def kind
  attributes.fetch(:kind)
end

#optionsCreateFileOptions

Additional options

Returns:



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

def options
  attributes.fetch(:options)
end

#to_hashObject



44
45
46
# File 'lib/language_server/protocol/interface/create_file.rb', line 44

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



48
49
50
# File 'lib/language_server/protocol/interface/create_file.rb', line 48

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

#uristring

The resource to create.

Returns:

  • (string)


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

def uri
  attributes.fetch(:uri)
end