Class: Steep::Diagnostic::Ruby::MethodDefinitionInUndeclaredModule

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/diagnostic/ruby.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(method_name:, node:) ⇒ MethodDefinitionInUndeclaredModule

Returns a new instance of MethodDefinitionInUndeclaredModule.



1043
1044
1045
1046
# File 'lib/steep/diagnostic/ruby.rb', line 1043

def initialize(method_name:, node:)
  @method_name = method_name
  super(node: node, location: (_ = node.loc).name)
end

Instance Attribute Details

#method_nameObject (readonly)

Returns the value of attribute method_name.



1041
1042
1043
# File 'lib/steep/diagnostic/ruby.rb', line 1041

def method_name
  @method_name
end

Instance Method Details

#header_lineObject



1048
1049
1050
# File 'lib/steep/diagnostic/ruby.rb', line 1048

def header_line
  "Method `#{method_name}` is defined in undeclared module"
end