Convert Ruby hashes and arrays into struct-like objects.
gem install dorian-to_structAlso included in the aggregate gem:
gem install dorianto_struct -hRun to_struct -h for generated option details and to_struct -v for the installed version.
- The executable only exposes help/version. The useful API is loaded with
require "dorian/to_struct".
require "dorian/to_struct"
user = { "name" => "Dorian" }.to_struct
user.name # => "Dorian"
user.from_struct # => { "name" => "Dorian" }