Class: Steep::Diagnostic::Ruby::UndeclaredMethodDefinition
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(method_name:, type_name:, node:) ⇒ UndeclaredMethodDefinition
constructor
A new instance of UndeclaredMethodDefinition.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(method_name:, type_name:, node:) ⇒ UndeclaredMethodDefinition
Returns a new instance of UndeclaredMethodDefinition.
983 984 985 986 987 |
# File 'lib/steep/diagnostic/ruby.rb', line 983 def initialize(method_name:, type_name:, node:) @method_name = method_name @type_name = type_name super(node: node, location: (_ = node.loc).name) end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
981 982 983 |
# File 'lib/steep/diagnostic/ruby.rb', line 981 def method_name @method_name end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
981 982 983 |
# File 'lib/steep/diagnostic/ruby.rb', line 981 def type_name @type_name end |
Instance Method Details
#header_line ⇒ Object
989 990 991 992 993 994 995 996 997 998 999 1000 |
# File 'lib/steep/diagnostic/ruby.rb', line 989 def header_line name = case node.type when :def "#{type_name}##{method_name}" when :defs "#{type_name}.#{method_name}" else raise end "Method `#{name}` is not declared in RBS" end |