Class: Steep::Diagnostic::Ruby::NoMethod
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, type:, method:) ⇒ NoMethod
constructor
A new instance of NoMethod.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, type:, method:) ⇒ NoMethod
Returns a new instance of NoMethod.
241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/steep/diagnostic/ruby.rb', line 241 def initialize(node:, type:, method:) loc = case node.type when :send loc = _ = nil loc ||= node.loc.operator if node.loc.respond_to?(:operator) # steep:ignore NoMethod loc ||= node.loc.selector if node.loc.respond_to?(:selector) # steep:ignore NoMethod loc when :block node.children[0].loc.selector end super(node: node, location: loc || node.loc.expression) @type = type @method = method end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
239 240 241 |
# File 'lib/steep/diagnostic/ruby.rb', line 239 def method @method end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
238 239 240 |
# File 'lib/steep/diagnostic/ruby.rb', line 238 def type @type end |
Instance Method Details
#header_line ⇒ Object
256 257 258 |
# File 'lib/steep/diagnostic/ruby.rb', line 256 def header_line "Type `#{type}` does not have method `#{method}`" end |