refactor by pokotyamu #10
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
リファクタ案です 👍
プログラムの最終行には、改行を入れるようにしましょう。
これがなくてもプログラムとしては、大丈夫だけど、プログラムを書く時のお約束事のようなものなので、エディター側で保存する時に自動的に補完されるような設定を書くと良いと思います!
詳しく知りたいなら
EOF new lineなどで検索するとわかると思います:pray:テストケースを条件毎に分けて書くことで、それがどんなことをテストしているか?というのがコードを読まずに分かるという利点があります🙋
今回のケースのように転置行列を求めるメソッドが既に Array クラスに用意されているので、こちらを使う方が良さそうです。
instance method Array#transpose (Ruby 2.4.0)
arrayだとだたの配列の印象がしたので、行列を意味するmatrixに変更しました♻️メソッド名としては動詞のほうが適しているので、名詞の
transportより動詞のtransposeに変更しました♻️