Class: Mui::Lsp::Handlers::Base
- Inherits:
-
Object
- Object
- Mui::Lsp::Handlers::Base
- Defined in:
- lib/mui/lsp/handlers/base.rb
Overview
Base class for LSP response handlers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#editor ⇒ Object
readonly
Returns the value of attribute editor.
Instance Method Summary collapse
- #handle(result, error) ⇒ Object
-
#initialize(editor:, client:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(editor:, client:) ⇒ Base
10 11 12 13 |
# File 'lib/mui/lsp/handlers/base.rb', line 10 def initialize(editor:, client:) @editor = editor @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/mui/lsp/handlers/base.rb', line 8 def client @client end |
#editor ⇒ Object (readonly)
Returns the value of attribute editor.
8 9 10 |
# File 'lib/mui/lsp/handlers/base.rb', line 8 def editor @editor end |
Instance Method Details
#handle(result, error) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mui/lsp/handlers/base.rb', line 15 def handle(result, error) if error handle_error(error) elsif result handle_result(result) else handle_empty end end |