nil(NilClass的实例)中也定义了一些方法。
下面是从参考手册中照搬来的内容:
self & other
通常返回false。
false
self | other
self ^ other
若other为真则返回true, 为假则返回false。
nil?
通常返回true。
true
to_a
返回空的数组[]。
[]
to_f ((<ruby 1.7 feature>))
返回0.0。
to_i
返回0。
to_s
返回空字符串""。
""