module ActiveRecord::AttributeMethods

def attribute_names

# => ["id", "created_at", "updated_at", "name", "age"]
person.attribute_names
person = Person.new

end
class Person < ActiveRecord::Base

Returns an array of names for the attributes available on this object.
def attribute_names
  @attributes.keys
end