红宝石编程/对象/NilClass
外观
< 红宝石编程
i0 = 1
loop {
i1 = 2
print defined?(i0), "\n" # true; "i0" was initialized in the ascendant block
print defined?(i1), "\n" # true; "i1" was initialized in this block
break
}
print defined?(i0), "\n" # true; "i0 was initialized in this block
print defined?(i1), "\n" # false; "i1" was initialized in the loop