class UserModel
attr_accessor :id, :name, :active, :roles
def initialize(id:, name:, active:, roles:)
@id = id
@name = name
@active = active
@roles = roles
end
end
FAQ
Why use the Ruby route instead of the PHP or Elixir routes?
Choose the Ruby route when your target stack is Ruby and you want plain PORO classes with `attr_accessor` and initializer arguments rather than PHP DTO properties or Elixir struct modules.
Does the Ruby route scaffold nested arrays and child objects?
Yes. Nested objects become additional Ruby classes, and repeated values are inferred from the sample JSON payload so the resulting models stay structured.