class RuboCop::Cop::Lint::Eval

This cop checks for the use of *Kernel#eval*.

Constants

MSG

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/lint/eval.rb, line 10
def on_send(node)
  receiver, method_name, *args = *node

  return unless receiver.nil? &&
                method_name == :eval &&
                !args.empty? &&
                args.first.type != :str
  add_offense(node, :selector)
end