0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ruby コーティング規約について レイアウト編 2

Last updated at Posted at 2020-02-01

はじめに

前回の続きです。
Rubyの基礎を学習中の方に向けて記載致します。
私自身これからチーム開発を行う上で大事にしたい。知っておきたいことをOutputします。

#レイアウトについて
① クラス、メソッドの本文の前後には、空行を用いない。

qiita.rb
#悪い例
class Dog

  def dog

    do_something do

      something

    end

  end

end

# 良い例
class Dog
  def dog
    do_something do
      something
    end
  end
end

②メソッド呼び出しの最後の引数のコンマはしない。

qiita.rb
# 悪い例
some_method(
  punch,
  kick,
  jump,
)

# 悪い例
some_method(punch, kick, jump, )

# 良い例
some_method(punch, kick, jump)

#さいごに
毎日更新します。
皆様の復習等にご活用頂けますと幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?