This file contains hidden or 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
| # Yes, monkey patching, you can easily do it without too. | |
| class OpenStruct | |
| ## | |
| # Deep convert to hash | |
| def deep_to_h | |
| each_pair.map do |key, value| | |
| [ | |
| key, | |
| case value | |
| when OpenStruct |