Class: RuboCop::Cop::Kata::IoDiscipline

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/kata/io_discipline.rb

Constant Summary collapse

MSG =
"Write through the injected `@io`, not bare `%s`."
RESTRICT_ON_SEND =
%i[puts warn pp p].freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



10
11
12
13
14
# File 'lib/rubocop/cop/kata/io_discipline.rb', line 10

def on_send(node)
  bare_output?(node) do |method|
    add_offense(node, message: format(MSG, method))
  end
end