Class: Steep::Diagnostic::Ruby::DifferentMethodParameterKind

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:) ⇒ DifferentMethodParameterKind

Returns a new instance of DifferentMethodParameterKind.



477
478
479
480
481
# File 'lib/steep/diagnostic/ruby.rb', line 477

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.



474
475
476
# File 'lib/steep/diagnostic/ruby.rb', line 474

def method_param
  @method_param
end

#method_typeObject (readonly)

Returns the value of attribute method_type.



475
476
477
# File 'lib/steep/diagnostic/ruby.rb', line 475

def method_type
  @method_type
end

Instance Method Details

#header_lineObject



483
484
485
# File 'lib/steep/diagnostic/ruby.rb', line 483

def header_line
  "The method parameter has different kind from the declaration `#{method_type}`"
end