Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #80 - Indentation on multi-line method calls

  • Loading branch information...
commit 4e982677f24f73f79e8a9c67b364630e8d9dc154 1 parent 232e98d
Bozhidar Batsov authored
Showing with 35 additions and 0 deletions.
  1. +35 −0 README.md
View
35 README.md
@@ -157,6 +157,41 @@ You can generate a PDF or an HTML copy of this guide using
end
```
+* Align the parameters of a method call if they span over multiple lines.
+
+ ```Ruby
+ # starting point (line is too long)
+ def send_mail(source)
+ Mailer.deliver(to: 'bob@example.com', from: 'us@example.com', subject: 'Important message', body: source.text)
+ end
+
+ # bad (normal indent)
+ def send_mail(source)
+ Mailer.deliver(
+ to: 'bob@example.com',
+ from: 'us@example.com',
+ subject: 'Important message',
+ body: source.text)
+ end
+
+ # bad (double indent)
+ def send_mail(source)
+ Mailer.deliver(
+ to: 'bob@example.com',
+ from: 'us@example.com',
+ subject: 'Important message',
+ body: source.text)
+ end
+
+ # good
+ def send_mail(source)
+ Mailer.deliver(to: 'bob@example.com',
+ from: 'us@example.com',
+ subject: 'Important message',
+ body: source.text)
+ end
+ ```
+
* Use RDoc and its conventions for API documentation. Don't put an
empty line between the comment block and the `def`.
* Keep lines fewer than 80 characters.
Please sign in to comment.
Something went wrong with that request. Please try again.