Class: LspRouter::Config::Server
- Inherits:
-
Object
- Object
- LspRouter::Config::Server
- Defined in:
- lib/lsp_router/config.rb
Overview
server
Instance Attribute Summary collapse
-
#attr ⇒ Object
readonly
Returns the value of attribute attr.
Instance Method Summary collapse
- #command(cmd) ⇒ Object
- #info ⇒ String
-
#initialize(name, &block) ⇒ Server
constructor
A new instance of Server.
- #mode(m) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Server
Returns a new instance of Server.
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
#attr ⇒ Object (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
60 61 62 |
# File 'lib/lsp_router/config.rb', line 60 def command(cmd) @attr[:command] = cmd end |
#info ⇒ String
70 71 72 |
# File 'lib/lsp_router/config.rb', line 70 def info "[#{attr[:name]}] #{attr[:command]}" end |
#mode(m) ⇒ Object
65 66 67 |
# File 'lib/lsp_router/config.rb', line 65 def mode(m) @attr[:mode] = m end |