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.



1006
1007
1008
1009
# File 'lib/steep/diagnostic/ruby.rb', line 1006

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.



1004
1005
1006
# File 'lib/steep/diagnostic/ruby.rb', line 1004

def method_name
  @method_name
end

Instance Method Details

#header_lineObject



1011
1012
1013
# File 'lib/steep/diagnostic/ruby.rb', line 1011

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