method

class_variable_defined?

v2_1_10 - Show latest stable - Class: Module
class_variable_defined?(p1)
public

Returns true if the given class variable is defined in obj. String arguments are converted to symbols.

class Fred
  @@foo = 99
end
Fred.class_variable_defined?(:@@foo)    #=> true
Fred.class_variable_defined?(:@@bar)    #=> false