obj.class_variable_defined?(symbol) â true or false
Instance Public methods
Returns true
if the given class variable is defined in
obj.
class Fred @@foo = 99 end Fred.class_variable_defined?(:@@foo) #=> true Fred.class_variable_defined?(:@@bar) #=> false
Please login to continue.