Class: RubyLsp::RequestConfig
- Inherits:
-
Object
- Object
- RubyLsp::RequestConfig
- Defined in:
- lib/ruby_lsp/utils.rb
Overview
A request configuration, to turn on/off features
Instance Method Summary collapse
-
#enabled?(feature) ⇒ Boolean
: (Symbol feature) -> bool?.
-
#initialize(configuration) ⇒ RequestConfig
constructor
: (Hash[Symbol, bool] configuration) -> void.
-
#merge!(hash) ⇒ Object
: (Hash[Symbol, bool]) -> void.
Constructor Details
#initialize(configuration) ⇒ RequestConfig
: (Hash[Symbol, bool] configuration) -> void
251 252 253 |
# File 'lib/ruby_lsp/utils.rb', line 251 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#enabled?(feature) ⇒ Boolean
: (Symbol feature) -> bool?
256 257 258 |
# File 'lib/ruby_lsp/utils.rb', line 256 def enabled?(feature) @configuration[:enableAll] || @configuration[feature] end |
#merge!(hash) ⇒ Object
: (Hash[Symbol, bool]) -> void
261 262 263 |
# File 'lib/ruby_lsp/utils.rb', line 261 def merge!(hash) @configuration.merge!(hash) end |