Shale is a Ruby object mapper and serializer for JSON, YAML, TOML, CSV and XML. It allows you to parse JSON, YAML, TOML, CSV and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML, TOML, CSV or XML.
I have a big CSV file that I'd like to extract several columns.
Previously, I would resolve those:
I tried
Person.from_csv(context, headers: true, only: valid_columns)
but it ignores the optiononly
.If I explicitly map each column as an attribute to be ignored, that works. Is there a more efficient way to do this?