检查是否认义了变量? - Checking if a variable is defined?

问题:

How can I check whether a variable is defined in Ruby? 如何检查Ruby中是否认义了变量? Is there an isset -type method available? 是否有isset type方法? spa


解决方案:

参考一: https://stackoom.com/question/1D6h/检查是否认义了变量
参考二: https://oldbug.net/q/1D6h/Checking-if-a-variable-is-defined