Class: Steep::Diagnostic::Ruby::MethodParameterMismatch

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_param:, method_type:) ⇒ MethodParameterMismatch

Returns a new instance of MethodParameterMismatch.



462
463
464
465
466
# File 'lib/steep/diagnostic/ruby.rb', line 462

def initialize(method_param:, method_type:)
  super(node: method_param.node)
  @method_param = method_param
  @method_type = method_type
end

Instance Attribute Details

#method_paramObject (readonly)

Returns the value of attribute method_param.



459
460
461
# File 'lib/steep/diagnostic/ruby.rb', line 459

def method_param
  @method_param
end

#method_typeObject (readonly)

Returns the value of attribute method_type.



460
461
462
# File 'lib/steep/diagnostic/ruby.rb', line 460

def method_type
  @method_type
end

Instance Method Details

#header_lineObject



468
469
470
# File 'lib/steep/diagnostic/ruby.rb', line 468

def header_line
  "The method parameter is incompatible with the declaration `#{method_type}`"
end