Method: RuboCop::Cop::Style::InverseMethods#correct_inverse_block

Defined in:
lib/rubocop/cop/style/inverse_methods.rb

#correct_inverse_block(node) ⇒ Object



102
103
104
105
106
107
108
109
110
# File 'lib/rubocop/cop/style/inverse_methods.rb', line 102

def correct_inverse_block(node)
  method_call, method, block = inverse_block?(node)

  lambda do |corrector|
    corrector.replace(method_call.loc.selector,
                      inverse_blocks[method].to_s)
    correct_inverse_selector(block, corrector)
  end
end