Class: Steep::Diagnostic::Ruby::ElseOnExhaustiveCase

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/diagnostic/deprecated/else_on_exhaustive_case.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, type:) ⇒ ElseOnExhaustiveCase

Returns a new instance of ElseOnExhaustiveCase.



9
10
11
12
# File 'lib/steep/diagnostic/deprecated/else_on_exhaustive_case.rb', line 9

def initialize(node:, type:)
  super(node: node)
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/steep/diagnostic/deprecated/else_on_exhaustive_case.rb', line 7

def type
  @type
end

Instance Method Details

#header_lineObject



14
15
16
# File 'lib/steep/diagnostic/deprecated/else_on_exhaustive_case.rb', line 14

def header_line
  "The branch is unreachable because the condition is exhaustive"
end