Skip to content

Files

Latest commit

 

History

History
20 lines (12 loc) · 768 Bytes

Style-CollectionMethods.md

File metadata and controls

20 lines (12 loc) · 768 Bytes

Pattern: Misused method from Enumerable module

Issue: -

Description

This rule enforces the use of consistent method names from the Enumerable module.

Unfortunately this rule cannot actually know if a method is from Enumerable or not (static analysis limitation), so it can yield some false positives.

Default configuration

Attribute Value
PreferredMethods {"collect"=>"map", "collect!"=>"map!", "inject"=>"reduce", "detect"=>"find", "find_all"=>"select"}

Further Reading