Class: Steep::Diagnostic::Ruby::MethodArityMismatch
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#method_type ⇒ Object
readonly
Returns the value of attribute method_type.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, method_type:) ⇒ MethodArityMismatch
constructor
A new instance of MethodArityMismatch.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, method_type:) ⇒ MethodArityMismatch
Returns a new instance of MethodArityMismatch.
442 443 444 445 446 447 448 449 450 451 |
# File 'lib/steep/diagnostic/ruby.rb', line 442 def initialize(node:, method_type:) args = case node.type when :def node.children[1] when :defs node.children[2] end #: Parser::AST::Node? super(node: node, location: args&.loc&.expression || node.loc.name) # steep:ignore NoMethod @method_type = method_type end |
Instance Attribute Details
#method_type ⇒ Object (readonly)
Returns the value of attribute method_type.
440 441 442 |
# File 'lib/steep/diagnostic/ruby.rb', line 440 def method_type @method_type end |
Instance Method Details
#header_line ⇒ Object
453 454 455 |
# File 'lib/steep/diagnostic/ruby.rb', line 453 def header_line "Method parameters are incompatible with declaration `#{method_type}`" end |