I am aware of this feature provided by ActiveSupport.
h = ActiveSupport::OrderedOptions.new
h.boy = \'John\'
h.girl = \'Mary\'
h.boy # => \'John\'
h.girl # =
I created my own gem for this, and I've been using it in all my projects. Seems to do just what you need:
large_hash = { boy: 'John', girl: 'Mary' }
r = Ribbon.wrap large_hash
r.boy
=> "John"
r.girl
=> "Mary"
r.keys
=> [:boy, :girl]
r.each_pair { |key, value| puts "#{key} => #{value}" }
boy => John
girl => Mary
Would love some feedback.