Ruby Options
The configuration options for Ruby are listed below.
Collection Type
Choose the outer collection syntax:
arrayfor[ ... ]listforArray[ ... ]
Assign to Variable
When enabled, output is assigned to a named variable like:
data = [
{ 'name' => 'Alice' },
]
Use Variable Name to configure the assigned name.
Output Wrapper
Choose how the generated collection is wrapped:
plainfor normal Ruby output (assignment if enabled)rspec-letforlet(:name) do ... endoutput
Number Convert
When enabled, numeric-looking values are quoted as strings.
When disabled, numeric-looking values are emitted as numeric literals.
Hash Key Style
Controls hash key syntax when Anonymous Objects is enabled:
stringfor'name' => 'Alice'symbolforname: 'Alice'
Anonymous Objects
When enabled, each row is output as a hash (map/dictionary equivalent).
When disabled, each row is output as an instantiated object, and a class definition is included.
Use Object Name to configure the class name when anonymous objects are disabled.
Object Representation
When Anonymous Objects is disabled, choose the row object style:
classgenerates a class withattr_accessorandinitializestructgeneratesStruct.new(...)datageneratesData.define(...)
Field Name Style
Controls how Ruby field names are generated for object fields and hash keys:
preservekeeps source header style (sanitized for valid Ruby identifiers)snake_caseconverts names tosnake_casebefore sanitization
Pretty Print
When enabled, output uses line breaks and indentation.
Hash Pretty Style
Controls formatting of anonymous hash rows when pretty print is enabled:
compactkeeps each hash on one linealignedrenders multi-line hashes with aligned entries
Delimiter
Choose indentation delimiter:
- tab
- space
- custom value
For custom value, set Custom Delimiter.