Class: Steep::Diagnostic::Ruby::UnexpectedBlockGiven

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:) ⇒ UnexpectedBlockGiven

Returns a new instance of UnexpectedBlockGiven.



301
302
303
304
305
# File 'lib/steep/diagnostic/ruby.rb', line 301

def initialize(node:, method_type:)
  loc = node.loc.begin.join(node.loc.end) # steep:ignore NoMethod
  super(node: node, location: loc)
  @method_type = method_type
end

Instance Attribute Details

#method_typeObject (readonly)

Returns the value of attribute method_type.



299
300
301
# File 'lib/steep/diagnostic/ruby.rb', line 299

def method_type
  @method_type
end

Instance Method Details

#header_lineObject



307
308
309
# File 'lib/steep/diagnostic/ruby.rb', line 307

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