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.
1020 1021 1022 1023 1024 |
# File 'lib/steep/diagnostic/ruby.rb', line 1020 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.
1018 1019 1020 |
# File 'lib/steep/diagnostic/ruby.rb', line 1018 def method_name @method_name end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
1018 1019 1020 |
# File 'lib/steep/diagnostic/ruby.rb', line 1018 def type_name @type_name end |
Instance Method Details
#header_line ⇒ Object
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/steep/diagnostic/ruby.rb', line 1026 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 |