2
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 1 year has passed since last update.

[Rubocop] [Correctable] Style/CaseLikeIf: Convert if-elsif to case-when.

Posted at
実行したコマンド
$ rubocop -a
rubocop からのご指摘
[Correctable] Style/CaseLikeIf: Convert if-elsif to case-when.

  指摘されたコード
 ^^^^^^^^^^^^^^^^^^
修正前
if hoge = a
    
    # 処理内容

elsif hoge = b

    # 処理内容

elsif hoge = c

    # 処理内容

end

修正後
case hoge 

    when a
    
    # 処理内容

    when b

    # 処理内容

    when c

    # 処理内容

end

2
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
2
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?