Skip to content

Repository files navigation

dorian-to_struct

Convert Ruby hashes and arrays into struct-like objects.

Install

gem install dorian-to_struct

Also included in the aggregate gem:

gem install dorian

Usage

to_struct -h

Run to_struct -h for generated option details and to_struct -v for the installed version.

Notes

  • The executable only exposes help/version. The useful API is loaded with require "dorian/to_struct".

Examples

Access hash keys as methods

require "dorian/to_struct"

user = { "name" => "Dorian" }.to_struct
user.name # => "Dorian"
user.from_struct # => { "name" => "Dorian" }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages