ruby - Rails check if an array exists -


sorry noobish question; started developing rails. checked through api, documentation, , did bunch of searches not find for.

is there method check see if specific array exists?

for example,

    array = []     array = [2,3,4]     if array.exists?       puts "array exists!"     else       puts "no such thing!"     end 

thanks

like so:

if defined?(array) 

instance variables (eg @array) default nil, can test them

if @array 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -