Class: Steep::Diagnostic::Ruby::IncompatibleArgumentForwarding

Inherits:
Base
  • Object
show all
Includes:
Steep::Diagnostic::ResultPrinter2
Defined in:
lib/steep/diagnostic/ruby.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods included from Steep::Diagnostic::ResultPrinter2

#detail_lines, #result_line

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(method_name:, node:, params_pair: nil, block_pair: nil, result:) ⇒ IncompatibleArgumentForwarding

Returns a new instance of IncompatibleArgumentForwarding.



899
900
901
902
903
904
905
# File 'lib/steep/diagnostic/ruby.rb', line 899

def initialize(method_name:, node:, params_pair: nil, block_pair: nil, result:)
  super(node: node)
  @method_name = method_name
  @result = result
  @params_pair = params_pair
  @block_pair = block_pair
end

Instance Attribute Details

#block_pairObject (readonly)

Returns the value of attribute block_pair.



897
898
899
# File 'lib/steep/diagnostic/ruby.rb', line 897

def block_pair
  @block_pair
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



897
898
899
# File 'lib/steep/diagnostic/ruby.rb', line 897

def method_name
  @method_name
end

#params_pairObject (readonly)

Returns the value of attribute params_pair.



897
898
899
# File 'lib/steep/diagnostic/ruby.rb', line 897

def params_pair
  @params_pair
end

#resultObject (readonly)

Returns the value of attribute result.



897
898
899
# File 'lib/steep/diagnostic/ruby.rb', line 897

def result
  @result
end

Instance Method Details

#header_lineObject



909
910
911
912
913
914
915
916
917
918
# File 'lib/steep/diagnostic/ruby.rb', line 909

def header_line
  case
  when params_pair
    "Cannot forward arguments to `#{method_name}`:"
  when block_pair
    "Cannot forward block to `#{method_name}`:"
  else
    raise
  end
end