method
attribute_names
v6.0.0 -
Show latest stable
- Class:
ActiveModel::Attributes
attribute_names()public
Returns an array of attribute names as strings
class Person include ActiveModel::Attributes attribute :name, :string attribute :age, :integer end person = Person.new person.attribute_names # => ["name", "age"]