method

new

v7.1.3.2 - Show latest stable - Class: ActiveModel::API
new(attributes = {})
public

Initializes a new model with the given params.

class Person
  include ActiveModel::API
  attr_accessor :name, :age
end

person = Person.new(name: 'bob', age: '18')
person.name # => "bob"
person.age  # => "18"