class Person
  def initialize
    @name = ""
    @age = 0
  end
end

person = Person.new
instance_variables
person.instance_variables     # => [:@name, :@age]
ancestors
Person.ancestors              # => [Person, Object, Kernel, BasicObject]