class Foo
  @@xyz = nil
  def initialize(name, age)
    @name, @age = name, age
  end
  def add_sex(sex)
    @sex = sex
  end
end

p foo = Foo.new(, 18)            
p foo.instance_variables                
p foo.instance_variable_defined?(:@age) 
p foo.instance_variable_get(:@age)      
p foo.instance_variable_set(:@age, 19)  
p foo                                   
foo.add_sex(:woman)
p foo.instance_variables                
p foo                                   
foo.instance_variable_set(:@bar, nil)
p foo.instance_variables                

p Foo.class_variables                   
p Foo.class_variable_defined?(:@@xyz)   
p Foo.class_variable_get(:@@xyz)        
p Foo.class_variable_set(:@@xyz, :xyz)  
p Foo.class_variable_get(:@@xyz)        
p Foo.class_variable_set(:@@abc, 123)   
p Foo.class_variables