Joined August 2017
·

cruz

make software
·
nc
·
·
·

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
Achievements
1 Karma
0 Total ProTip Views
Interests & Skills