module ActiveModel::Attributes::ClassMethods

def attribute_names

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

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