Class: LSP::Command
Overview
export interface Command
/**
* Title of the command, like `save`.
*/
title: string;
/**
* The identifier of the actual command handler.
*/
command: string;
/**
* Arguments that the command handler should be
* invoked with.
*/
arguments?: any[];
Instance Attribute Summary collapse
-
#arguments ⇒ Object
type: string # type: string # type: any[].
-
#command ⇒ Object
type: string # type: string # type: any[].
-
#title ⇒ Object
type: string # type: string # type: any[].
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ Command
constructor
A new instance of Command.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ Command
Returns a new instance of Command.
343 344 345 346 |
# File 'lib/lsp/lsp_types.rb', line 343 def initialize(initial_hash = nil) super @optional_method_names = i[arguments] end |
Instance Attribute Details
#arguments ⇒ Object
type: string # type: string # type: any[]
341 342 343 |
# File 'lib/lsp/lsp_types.rb', line 341 def arguments @arguments end |
#command ⇒ Object
type: string # type: string # type: any[]
341 342 343 |
# File 'lib/lsp/lsp_types.rb', line 341 def command @command end |
#title ⇒ Object
type: string # type: string # type: any[]
341 342 343 |
# File 'lib/lsp/lsp_types.rb', line 341 def title @title end |
Instance Method Details
#from_h!(value) ⇒ Object
348 349 350 351 352 353 354 |
# File 'lib/lsp/lsp_types.rb', line 348 def from_h!(value) value = {} if value.nil? self.title = value['title'] self.command = value['command'] self.arguments = value['arguments'].map { |val| val } unless value['arguments'].nil? self end |