method

attribute_names

rails latest stable - Class: ActiveModel::Attributes::ClassMethods
attribute_names()
public

Returns an array of attribute names as strings.

class Person
  include ActiveModel::Attributes

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

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