module CoreExtensions

Public Instance Methods

to_struct() click to toggle source
# File lib/utils/hash_extension.rb, line 3
def to_struct
  OpenStruct.new(self.each_with_object({}) do |(key, val), acc|
    acc[key] = val.is_a?(Hash) ? val.to_struct : val
  end)
end