@@ -157,21 +157,21 @@ You can generate a PDF or an HTML copy of this guide using
157
157
end
158
158
` ` `
159
159
160
- * Align the parameters of a method call if they span over multiple lines.
160
+ * Indent the parameters of a method call with two spaces if they span over multiple lines.
161
+ Optionally place the trailing ` )` on its own line returning to the parent indentation.
161
162
162
163
` ` ` Ruby
163
164
# starting point (line is too long)
164
165
def send_mail(source)
165
166
Mailer.deliver(to: 'bob@example.com', from: 'us@example.com', subject: 'Important message', body: source.text)
166
167
end
167
168
168
- # bad (normal indent)
169
+ # bad (large indent aligning with the method's open-parenthesis)
169
170
def send_mail(source)
170
- Mailer.deliver(
171
- to: 'bob@example.com',
172
- from: 'us@example.com',
173
- subject: 'Important message',
174
- body: source.text)
171
+ Mailer.deliver(to: 'bob@example.com',
172
+ from: 'us@example.com',
173
+ subject: 'Important message',
174
+ body: source.text)
175
175
end
176
176
177
177
# bad (double indent)
@@ -183,12 +183,23 @@ You can generate a PDF or an HTML copy of this guide using
183
183
body: source.text)
184
184
end
185
185
186
- # good
186
+ # good (two space indent)
187
187
def send_mail(source)
188
- Mailer.deliver(to: 'bob@example.com',
189
- from: 'us@example.com',
190
- subject: 'Important message',
191
- body: source.text)
188
+ Mailer.deliver(
189
+ to: 'bob@example.com',
190
+ from: 'us@example.com',
191
+ subject: 'Important message',
192
+ body: source.text)
193
+ end
194
+
195
+ # good (two space indent with close parenthesis returning to parent indent)
196
+ def send_mail(source)
197
+ Mailer.deliver(
198
+ to: 'bob@example.com',
199
+ from: 'us@example.com',
200
+ subject: 'Important message',
201
+ body: source.text
202
+ )
192
203
end
193
204
` ` `
194
205
0 commit comments