Skip to content

Conversation

@kmdsbng
Copy link

@kmdsbng kmdsbng commented Nov 7, 2013

回答書きました。レビューお願いします!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ネームスペースとして使うなら module の方が向いているように思います。(他に理由があったらごめんなさい。)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確かにそうかも!
僕は特にこだわりなく、クラスにしてしまいます。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なんとなくRuby界隈ではネームスペースにmoduleを使う文化があるように思うのですが、この辺りは好みなのかもですね。

real_hit_count = total_hit_count - match_count
で求めるようにした。
total_hit_countを書きなおした
@kmdsbng
Copy link
Author

kmdsbng commented Nov 8, 2013

ひどい感じだったところを書き直しました。

  • class -> module に変えました
  • real_hit_count = total_hit_count - match_count で計算するようにしました。

@Sixeight
Copy link
Member

Sixeight commented Nov 8, 2013

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

無駄知識ですが、以下で同じ意味です。

inject(:+)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはオシャレ かつ 便利!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants