module ActiveModel::Attributes::ClassMethods

def attribute_names

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

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

include ActiveModel::Attributes
class Person

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