module ActiveModel::Attributes

def attribute_names

person.attribute_names # => ["name", "age"]
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