If you are stuck using 1.8.7 for any reason (like me), I resorted to using active_support/ordered_hash . I know that activesupport seems great, but they reorganized it in later versions, where you pretty much only need the part that you need in the file, and the rest is left unattended. Just gem install activesupport and enable it as shown below. Also, in your YAML file, be sure to use the omap declaration (and the hash array). Sample time!
# config.yml
This is what Ruby looks like behind it.
# loader.rb
I am looking for a solution that allows me to dig out Hash loaded from an .yml file .yml , look for those YAML::PrivateClass and convert them to ActiveSupport::OrderedHash . May I ask a question.
source share