Class: Steep::Diagnostic::Ruby::RequiredBlockMissing

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:, method_type:) ⇒ RequiredBlockMissing

Returns a new instance of RequiredBlockMissing.



315
316
317
318
# File 'lib/steep/diagnostic/ruby.rb', line 315

def initialize(node:, method_type:)
  super(node: node, location: (node.type == :super || node.type == :zsuper) ? node.loc.keyword : node.loc.selector) # steep:ignore NoMethod
  @method_type = method_type
end

Instance Attribute Details

#method_typeObject (readonly)

Returns the value of attribute method_type.



313
314
315
# File 'lib/steep/diagnostic/ruby.rb', line 313

def method_type
  @method_type
end

Instance Method Details

#header_lineObject



320
321
322
# File 'lib/steep/diagnostic/ruby.rb', line 320

def header_line
  "The method cannot be called without a block"
end