Skip to content

Instantly share code, notes, and snippets.

@bencrouse
Created May 8, 2014 13:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bencrouse/bc4c10fefa9d7affe3a6 to your computer and use it in GitHub Desktop.
Save bencrouse/bc4c10fefa9d7affe3a6 to your computer and use it in GitHub Desktop.
Arguments Style
# 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 (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
# good (normal indent)
def send_mail(source)
Mailer.deliver(
to: 'bob@example.com',
from: 'us@example.com',
subject: 'Important message',
body: source.text
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment