Skip to content

Commit

Permalink
Prefer each.with_index and each.with_object
Browse files Browse the repository at this point in the history
These methods encourage learning about other enumerable
possibilities (map.with_index, etc.).
Set no preference for other methods (collect, inject, etc.), so this
doesn’t have the side effect of enabling preferences for those.
  • Loading branch information
danielmorrison committed Dec 6, 2018
1 parent f9746b3 commit 933e9b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/ruby-2.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ AllCops:
Layout:
IndentHeredoc:
Enabled: false

CollectionMethods:
PreferredMethods:
each_with_index: 'each.with_index'
each_with_object: 'each.with_object'

0 comments on commit 933e9b1

Please sign in to comment.