Ruby: Module, Mixins and Blocks confusing?

前端 未结 5 631
忘了有多久
忘了有多久 2021-01-15 12:55

Following is the code I tried to run from the Ruby Programming Book http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html

Why doesn\'t the

5条回答
  •  遥遥无期
    2021-01-15 13:09

    Since that code example was written, Array has gained a #product method and you're seeing the output of that particular method. Rename your module's method to something like product_new.

提交回复
热议问题