Class: Steep::Diagnostic::Ruby::UnexpectedDynamicMethod

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(node:, module_name:, method_name:) ⇒ UnexpectedDynamicMethod

Returns a new instance of UnexpectedDynamicMethod.



594
595
596
597
598
# File 'lib/steep/diagnostic/ruby.rb', line 594

def initialize(node:, module_name:, method_name:)
  super(node: node, location: node.children[0].loc.expression)
  @module_name = module_name
  @method_name = method_name
end

Instance Attribute Details

#method_nameObject (readonly)

Returns the value of attribute method_name.



592
593
594
# File 'lib/steep/diagnostic/ruby.rb', line 592

def method_name
  @method_name
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



591
592
593
# File 'lib/steep/diagnostic/ruby.rb', line 591

def module_name
  @module_name
end

Instance Method Details

#header_lineObject



600
601
602
# File 'lib/steep/diagnostic/ruby.rb', line 600

def header_line
  "@dynamic annotation contains unknown method name `#{method_name}`"
end