Last active
January 24, 2023 19:57
-
-
Save smtlaissezfaire/ad1fbf6d2f765208a3de2b0ab9721e24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/47480803/construct-nested-openstruct-object | |
require 'json' | |
private def deep_openstruct(hash) | |
JSON.parse(hash.to_json, object_class: OpenStruct) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment