Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 498 Bytes

Performance-MapMethodChain.md

File metadata and controls

23 lines (14 loc) · 498 Bytes

Pattern: Use of map in a chain

Issue: -

Description

Checks if the map method is used in a chain.

Autocorrection is not supported because an appropriate block variable name cannot be determined automatically.

Examples

# bad
array.map(&:foo).map(&:bar)

# good
array.map { |item| item.foo.bar }

Further Reading