Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
デザインパターンの観点から Ruby モジュールの目的を理解しようとしています。
Rubyモジュールは本質的に、一度だけ初期化される単なるクラスですか?
include MyModule
クラスはモジュールですが、モジュールはクラスではありません。Moduleは文字通り のスーパークラスですClass。OOP を知っていれば、それだけで十分です。
Module
Class
Ruby モジュールは名前空間として使用し、ミックスインで使用するのが最適です。