Class: RubyLsp::SorbetLevel
- Inherits:
-
Object
- Object
- RubyLsp::SorbetLevel
- Defined in:
- lib/ruby_lsp/utils.rb
Class Method Summary collapse
-
.ignore ⇒ Object
: -> SorbetLevel.
Instance Method Summary collapse
-
#false? ⇒ Boolean
: -> bool.
-
#ignore? ⇒ Boolean
: -> bool.
-
#initialize(sigil) ⇒ SorbetLevel
constructor
: (String?) -> void.
-
#none? ⇒ Boolean
: -> bool.
-
#strict? ⇒ Boolean
: -> bool.
-
#true? ⇒ Boolean
: -> bool.
-
#true_or_higher? ⇒ Boolean
: -> bool.
Constructor Details
#initialize(sigil) ⇒ SorbetLevel
: (String?) -> void
275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/ruby_lsp/utils.rb', line 275 def initialize(sigil) @level = case sigil when "ignore" :ignore when "false" :false when "true" :true when "strict", "strong" :strict else :none end #: Symbol end |
Class Method Details
.ignore ⇒ Object
: -> SorbetLevel
269 270 271 |
# File 'lib/ruby_lsp/utils.rb', line 269 def ignore new("ignore") end |
Instance Method Details
#false? ⇒ Boolean
: -> bool
294 |
# File 'lib/ruby_lsp/utils.rb', line 294 def false? = @level == :false |
#ignore? ⇒ Boolean
: -> bool
291 |
# File 'lib/ruby_lsp/utils.rb', line 291 def ignore? = @level == :ignore |
#none? ⇒ Boolean
: -> bool
303 |
# File 'lib/ruby_lsp/utils.rb', line 303 def none? = @level == :none |
#strict? ⇒ Boolean
: -> bool
300 |
# File 'lib/ruby_lsp/utils.rb', line 300 def strict? = @level == :strict |
#true? ⇒ Boolean
: -> bool
297 |
# File 'lib/ruby_lsp/utils.rb', line 297 def true? = @level == :true |
#true_or_higher? ⇒ Boolean
: -> bool
306 |
# File 'lib/ruby_lsp/utils.rb', line 306 def true_or_higher? = @level == :true || @level == :strict |