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