Class: LspRouter::Config::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/lsp_router/config.rb

Overview

server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Server

Returns a new instance of Server.

Parameters:

  • name (String)


54
55
56
57
# File 'lib/lsp_router/config.rb', line 54

def initialize(name, &block)
  @attr = {name:}
  self.instance_eval(&block)
end

Instance Attribute Details

#attrObject (readonly)

Returns the value of attribute attr.



51
52
53
# File 'lib/lsp_router/config.rb', line 51

def attr
  @attr
end

Instance Method Details

#command(cmd) ⇒ Object

Parameters:

  • cmd (String)


60
61
62
# File 'lib/lsp_router/config.rb', line 60

def command(cmd)
  @attr[:command] = cmd
end

#infoString

Returns:

  • (String)


70
71
72
# File 'lib/lsp_router/config.rb', line 70

def info
  "[#{attr[:name]}] #{attr[:command]}"
end

#mode(m) ⇒ Object

Parameters:

  • m (Symbol)


65
66
67
# File 'lib/lsp_router/config.rb', line 65

def mode(m)
  @attr[:mode] = m
end