module ActiveModel::Attributes

def attribute_names

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

end
attribute :age, :integer
attribute :name, :string

include ActiveModel::Attributes
class Person

Returns an array of attribute names as strings
def attribute_names
  @attributes.keys
end