Expected behavior
Expected RuboCop to suggest valid corrections.
Actual behavior
C: Performance/ChainArrayAllocation: Use unchained values_at! and compact! (followed by return array if required)
instead of chaining values_at...compact.
options.values_at("alpha", "beta", "gamma").compact.length > 1
^^^^^^^^
Problem
Hash instances do not respond to :values_at!
Steps to reproduce the problem
Run RuboCop against the following code:
def foo?(options = {})
options.values_at("alpha", "beta", "gamma").compact.length > 1
end