Sha256: 098c024be73ae4d49fc9efefa570b7b9697a57763605bb200654d3ba0509bbf4

Contents?: true

Size: 303 Bytes

Versions: 25

Compression:

Stored size: 303 Bytes

Contents

# Recursively covert a nested hash into nested OpenStructs
# See https://coderwall.com/p/74rajw/convert-a-complex-nested-hash-to-an-object
module CoreExtensions
  module Hash
    module OpenStructConversion
      def to_o
        JSON.parse to_json, object_class: OpenStruct
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc7 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc6 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc5 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc4 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc3 lib/core_extensions/hash.rb