Class: Rubocop::Cop::Style::RaiseArgs

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/style/raise_args.rb

Overview

This cop checks the args passed to fail and raise.

Constant Summary

Constants inherited from Cop

Cop::OPERATOR_METHODS

Instance Attribute Summary

Attributes inherited from Cop

#config, #corrections, #offences, #processed_source

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, all, #autocorrect?, #convention, #cop_config, cop_name, #cop_name, cop_type, #debug?, #ignore_node, inherited, #initialize, lint?, non_rails, rails?, style?, #support_autocorrect?, #warning

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#on_send(node) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/rubocop/cop/style/raise_args.rb', line 8

def on_send(node)
  return unless command?(:raise, node) || command?(:fail, node)

  case style
  when :compact
    check_compact(node)
  when :exploded
    check_exploded(node)
  end
end