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.16 lib/core_extensions/hash.rb
renalware-core-2.0.15 lib/core_extensions/hash.rb
renalware-core-2.0.14 lib/core_extensions/hash.rb
renalware-core-2.0.13 lib/core_extensions/hash.rb
renalware-core-2.0.12 lib/core_extensions/hash.rb
renalware-core-2.0.11 lib/core_extensions/hash.rb
renalware-core-2.0.9 lib/core_extensions/hash.rb
renalware-core-2.0.8 lib/core_extensions/hash.rb
renalware-core-2.0.7 lib/core_extensions/hash.rb
renalware-core-2.0.5 lib/core_extensions/hash.rb
renalware-core-2.0.4 lib/core_extensions/hash.rb
renalware-core-2.0.3 lib/core_extensions/hash.rb
renalware-core-2.0.2 lib/core_extensions/hash.rb
renalware-core-2.0.1 lib/core_extensions/hash.rb
renalware-core-2.0.0 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc13 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc11 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc10 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc9 lib/core_extensions/hash.rb
renalware-core-2.0.0.pre.rc8 lib/core_extensions/hash.rb