Skip to content

Commit

Permalink
added rule to prefer pull.call() over its variants
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkbolte committed Aug 24, 2013
1 parent 97cef51 commit c8313e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,22 @@ you if you forget either of the rules above!
p = proc { |n| puts n }
```

* Prefer `proc.call()` over `proc[]` or `proc.()` for both lambdas and procs.

```Ruby
# bad - looks similar to Enumeration access
l = ->(v) { puts v }
l[1]
# also bad - uncommon syntax
l = ->(v) { puts v }
l.(1)
# good
l = ->(v) { puts v }
l.call(1)
```

* Use `_` for unused block parameters.

```Ruby
Expand Down

0 comments on commit c8313e8

Please sign in to comment.