Class: RubyLsp::SorbetLevel

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_lsp/utils.rb

Class Method Summary collapse

Instance Method Summary collapse

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

.ignoreObject

: -> SorbetLevel



269
270
271
# File 'lib/ruby_lsp/utils.rb', line 269

def ignore
  new("ignore")
end

Instance Method Details

#false?Boolean

: -> bool

Returns:

  • (Boolean)


294
# File 'lib/ruby_lsp/utils.rb', line 294

def false? = @level == :false

#ignore?Boolean

: -> bool

Returns:

  • (Boolean)


291
# File 'lib/ruby_lsp/utils.rb', line 291

def ignore? = @level == :ignore

#none?Boolean

: -> bool

Returns:

  • (Boolean)


303
# File 'lib/ruby_lsp/utils.rb', line 303

def none? = @level == :none

#strict?Boolean

: -> bool

Returns:

  • (Boolean)


300
# File 'lib/ruby_lsp/utils.rb', line 300

def strict? = @level == :strict

#true?Boolean

: -> bool

Returns:

  • (Boolean)


297
# File 'lib/ruby_lsp/utils.rb', line 297

def true? = @level == :true

#true_or_higher?Boolean

: -> bool

Returns:

  • (Boolean)


306
# File 'lib/ruby_lsp/utils.rb', line 306

def true_or_higher? = @level == :true || @level == :strict