{"id":22661065,"url":"https://github.com/sayantam/deep_hash_struct","last_synced_at":"2025-03-29T08:25:31.620Z","repository":{"id":62556946,"uuid":"280731577","full_name":"sayantam/deep_hash_struct","owner":"sayantam","description":"Converts a (possibly nested) Hash to a (nested) Struct.","archived":false,"fork":false,"pushed_at":"2020-07-21T19:33:59.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-25T00:34:01.001Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sayantam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-18T20:13:09.000Z","updated_at":"2020-08-29T08:34:46.000Z","dependencies_parsed_at":"2022-11-03T06:01:04.105Z","dependency_job_id":null,"html_url":"https://github.com/sayantam/deep_hash_struct","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayantam%2Fdeep_hash_struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayantam%2Fdeep_hash_struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayantam%2Fdeep_hash_struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayantam%2Fdeep_hash_struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sayantam","download_url":"https://codeload.github.com/sayantam/deep_hash_struct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246158674,"owners_count":20732846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-12-09T11:13:28.287Z","updated_at":"2025-03-29T08:25:31.597Z","avatar_url":"https://github.com/sayantam.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepHashStruct\n\nUtility function to convert a Hash to a Struct. The Hash can be arbitrarily nested, the corresponding\nobject will have same level of nesting.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'deep_hash_struct'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install deep_hash_struct\n\n## Usage\n\n```ruby\ninclude DeepHashStruct\n```\n\n### Example 1\n```ruby\ninput = { x: 1, y: { z: 2 } }\npoint = deep_struct(input)\npoint.x #=\u003e 1\npoint.y.z #=\u003e 2\n```\n\n### Example 2\n```ruby\ninput = { foo: [{ x: [{ y: { z: 1 } }] }] }\nobj = deep_struct(input)\nobj.foo[0].x[0].y.z #=\u003e 1\n```\n\n### Example 3\n```ruby\ninput = { foo: { bar: [{ x: 1 }]} }\nobj = deep_struct(input)\nobj.foo.bar[0].x #=\u003e 1\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sayantam/deep_struct. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the DeepStruct project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sayantam/deep_struct/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayantam%2Fdeep_hash_struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayantam%2Fdeep_hash_struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayantam%2Fdeep_hash_struct/lists"}