Class: Steep::Diagnostic::Ruby::ImplicitBreakValueMismatch

Inherits:
Base
  • Object
show all
Includes:
ResultPrinter
Defined in:
lib/steep/diagnostic/ruby.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods included from ResultPrinter

#detail_lines, #relation_message

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, jump_type:, result:) ⇒ ImplicitBreakValueMismatch

Returns a new instance of ImplicitBreakValueMismatch.



388
389
390
391
392
# File 'lib/steep/diagnostic/ruby.rb', line 388

def initialize(node:, jump_type:, result:)
  super(node: node)
  @jump_type = jump_type
  @result = result
end

Instance Attribute Details

#jump_typeObject (readonly)

Returns the value of attribute jump_type.



383
384
385
# File 'lib/steep/diagnostic/ruby.rb', line 383

def jump_type
  @jump_type
end

#resultObject (readonly)

Returns the value of attribute result.



384
385
386
# File 'lib/steep/diagnostic/ruby.rb', line 384

def result
  @result
end

Instance Method Details

#header_lineObject



394
395
396
# File 'lib/steep/diagnostic/ruby.rb', line 394

def header_line
  "Breaking without a value may result an error because a value of type `#{jump_type}` is expected"
end