class RuboCop::Cop::Style::SafeNavigation

def chain_size(method_chain, method)

def chain_size(method_chain, method)
  method.each_ancestor(:send).inject(0) do |total, ancestor|
    break total + 1 if ancestor == method_chain
    total + 1
  end
end