Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/hash.rb

Overview

Monkey-patching Hash

Instance Method Summary collapse

Instance Method Details

#to_open_structObject



4
5
6
7
8
9
10
11
12
# File 'lib/core_ext/hash.rb', line 4

def to_open_struct
  out = OpenStruct.new self

  out.each_pair do |k, v|
    out[k] = v.to_open_struct
  end

  out
end