Class: Steep::Diagnostic::Ruby::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, location: node&.location&.expression) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'lib/steep/diagnostic/ruby.rb', line 10

def initialize(node:, location: node&.location&.expression)
  @node = node
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



8
9
10
# File 'lib/steep/diagnostic/ruby.rb', line 8

def location
  @location
end

#nodeObject (readonly)

Returns the value of attribute node.



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

def node
  @node
end

Instance Method Details

#detail_linesObject



19
20
21
# File 'lib/steep/diagnostic/ruby.rb', line 19

def detail_lines
  nil
end

#diagnostic_codeObject



23
24
25
# File 'lib/steep/diagnostic/ruby.rb', line 23

def diagnostic_code
  "Ruby::#{error_name}"
end

#header_lineObject



15
16
17
# File 'lib/steep/diagnostic/ruby.rb', line 15

def header_line
  error_name
end