class OpsProcessor
Niceness
processor really
Constants
- MSG
Attributes
cop[R]
Public Class Methods
new(cop)
click to toggle source
# File lib/rubocop/cop/yast/ops.rb, line 80 def initialize(cop) @cop = cop end
Public Instance Methods
autocorrectable?(node)
click to toggle source
assumes node is an Ops.add
# File lib/rubocop/cop/yast/ops.rb, line 101 def autocorrectable?(node) RuboCop::Yast.logger.debug "AUTOCORRECTABLE?(#{node.inspect})" RuboCop::Yast.logger.debug "CUR SCOPE #{scope.inspect}" _ops, _method, a, b = *node nice(a) && nice(b) end
investigate(processed_source)
click to toggle source
# File lib/rubocop/cop/yast/ops.rb, line 84 def investigate(processed_source) process(processed_source.ast) end
on_send(node)
click to toggle source
Calls superclass method
# File lib/rubocop/cop/yast/ops.rb, line 90 def on_send(node) super receiver, message = *node return unless const_name(receiver) == "Ops" return unless RuboCop::Cop::Yast::Ops::REPLACEMENT.key?(message) return unless cop.strict_mode || autocorrectable?(node) cop.add_offense(node, :selector, format(MSG, message)) end