Class: RuboCop::Cop::Kata::ClockDiscipline

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

Constant Summary collapse

MSG =
"Inject a clock; `%s.%s` reads the ambient time."
RESTRICT_ON_SEND =
%i[now today current].freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



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

def on_send(node)
  bare_clock?(node) do |const, method|
    add_offense(node, message: format(MSG, const.const_name, method))
  end
end