periksa ruby ​​jika ada

apple = 1

defined?(apple)
# "local-variable"

defined?(bacon)
# nil
Hungry Hedgehog