So basically
# /config/initializers/hash.rb class Hash def to_o JSON.parse to_json, object_class: OpenStruct end end
Then you can call it anywhere in your project like
hash = { format: { html?: true }} hash.to_o.format.html? # => true
So basically
Then you can call it anywhere in your project like