Class: LSP::CreateFileOptions

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_types.rb

Overview

export interface CreateFileOptions

/**
 * Overwrite existing file. Overwrite wins over `ignoreIfExists`
 */
overwrite?: boolean;
/**
 * Ignore if exists.
 */
ignoreIfExists?: boolean;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CreateFileOptions

Returns a new instance of CreateFileOptions.



427
428
429
430
# File 'lib/lsp/lsp_types.rb', line 427

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[overwrite ignoreIfExists]
end

Instance Attribute Details

#ignoreIfExistsObject

type: boolean # type: boolean



425
426
427
# File 'lib/lsp/lsp_types.rb', line 425

def ignoreIfExists
  @ignoreIfExists
end

#overwriteObject

type: boolean # type: boolean



425
426
427
# File 'lib/lsp/lsp_types.rb', line 425

def overwrite
  @overwrite
end

Instance Method Details

#from_h!(value) ⇒ Object



432
433
434
435
436
437
# File 'lib/lsp/lsp_types.rb', line 432

def from_h!(value)
  value = {} if value.nil?
  self.overwrite = value['overwrite'] # Unknown type
  self.ignoreIfExists = value['ignoreIfExists'] # Unknown type
  self
end