Collections
Each of the core build strategies has a -list form that produces N
instances, plus a -pair shortcut for two. The same variant, override, and
block-form arguments accepted by the single-build methods carry over to the
collection methods.
build-list / create-list
1 2 | |
Each call evaluates the factory once per instance, so dynamic attributes (including sequences) advance just as they would with N separate calls.
Per-call variants and overrides
Pass variants and named overrides after the count — they apply to every instance:
1 2 | |
Block form
Pass a final callable to receive each built instance with its zero-based index:
1 2 3 4 5 | |
build-stubbed-list / attributes-for-list
Identical shape, different strategy. attributes-for-list returns an
Array[Hash]; build-stubbed-list returns stubbed instances that do not
touch the database.
1 2 | |
Pair shortcuts
build-pair and create-pair are the count-of-two convenience aliases.
They accept the same variants, overrides, and block form as the -list
methods:
1 2 3 4 5 | |