require和include有什么区别?

时间:2010-10-25 20:35:34

标签: ruby

  

可能重复:
  What is the difference between include and require in Ruby?

require File.join(File.dirname(__FILE__), 'load_test_data.rb')
require 'find'
require 'fileutils'

include CommonValidators

有人可以给我一个正确的例子来理解requireinclude之间的区别吗?

1 个答案:

答案 0 :(得分:2)