`
lfx_cool
  • 浏览: 67539 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

include and require

阅读更多
The "include" statement is for including a module into a class:
   1. module Bar
   2. end
   3. 
   4. class Foo
   5.   include Bar
   6. end

The "require" statement loads a ruby file.

Just loading a file does not include it into a class, so that's why you need include as well.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics