RuboCop::Cop
This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.
# File lib/rubocop/cop/style/proc.rb, line 23 def autocorrect(node) @corrections << lambda do |corrector| corrector.replace(node.loc.expression, 'proc') end end
# File lib/rubocop/cop/style/proc.rb, line 12 def on_block(node) # We're looking for # (block # (send # (const nil :Proc) :new) # ...) block_method, = *node add_offense(block_method, :expression) if block_method == TARGET end
[Validate]
Generated with the Darkfish Rdoc Generator 2.