3-19(晚) require_relative 和 require. === operator的解释。

kernel#require_relative 

Ruby tries to load the library named string relative to the requiring file's path. 就是说当前运行文件的目录下面找这个要加载的文件。

如:/Users/个人/Ruby元编程/object_model/hook.rb:

#require(name) -> true/false 

用于加载标准库,就是和Ruby一起安装的库。

from /Users/个人/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' 


https://stackoverflow.com/questions/4467538/what-does-the-operator-do-in-ruby

关于 === operator的用法。是一个包含运算符号:

a === b :a是否包含b,是的话返回true,不是返回false. 

t's a boolean operator which asks the question "If I have a drawer labelled a would it make sense to put b in that drawer?"
原文地址:https://www.cnblogs.com/chentianwei/p/8605467.html