File tree Expand file tree Collapse file tree 1 file changed +4
-21
lines changed Expand file tree Collapse file tree 1 file changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -521,28 +521,11 @@ style guide.
521
521
```
522
522
523
523
* <a name="consistent-multi-line-chains"></a>
524
- Adopt a consistent multi-line method chaining style. There are two popular
525
- styles in the Ruby community, both of which are considered
526
- good—leading `.` (Option A) and trailing `.` (Option B) .
524
+ When continuing a chained method invocation on another line,
525
+ include the `.` on the first line to indicate that the
526
+ expression continues .
527
527
<sup>[[link](#consistent-multi-line-chains)]</sup>
528
528
529
- * **(Option A)** When continuing a chained method invocation on
530
- another line keep the `.` on the second line.
531
-
532
- ```ruby
533
- # bad - need to consult first line to understand second line
534
- one.two.three.
535
- four
536
-
537
- # good - it's immediately clear what's going on the second line
538
- one.two.three
539
- .four
540
- ```
541
-
542
- * **(Option B)** When continuing a chained method invocation on another line,
543
- include the `.` on the first line to indicate that the
544
- expression continues.
545
-
546
529
```ruby
547
530
# bad - need to read ahead to the second line to know that the chain continues
548
531
one.two.three
@@ -553,7 +536,7 @@ style guide.
553
536
four
554
537
```
555
538
556
- A discussion on the merits of both alternative styles can be found
539
+ A discussion on the merits of alternative styles can be found
557
540
[here](https://github.com/bbatsov/ruby-style-guide/pull/176).
558
541
559
542
* <a name="no-double-indent"></a>
You can’t perform that action at this time.
0 commit comments