Sha256: f4060f6c3cdaabd9cd1112e856ddce93d1fd10406e49d83888d027c1241271d7

Contents?: true

Size: 334 Bytes

Versions: 142

Compression:

Stored size: 334 Bytes

Contents

# frozen_string_literal: true

# 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

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.62 lib/core_extensions/hash.rb
renalware-core-2.0.61 lib/core_extensions/hash.rb
renalware-core-2.0.60 lib/core_extensions/hash.rb
renalware-core-2.0.58 lib/core_extensions/hash.rb
renalware-core-2.0.57 lib/core_extensions/hash.rb
renalware-core-2.0.56 lib/core_extensions/hash.rb
renalware-core-2.0.55 lib/core_extensions/hash.rb
renalware-core-2.0.54 lib/core_extensions/hash.rb
renalware-core-2.0.53 lib/core_extensions/hash.rb
renalware-core-2.0.52 lib/core_extensions/hash.rb
renalware-core-2.0.51 lib/core_extensions/hash.rb
renalware-core-2.0.50 lib/core_extensions/hash.rb
renalware-core-2.0.48 lib/core_extensions/hash.rb
renalware-core-2.0.47 lib/core_extensions/hash.rb
renalware-core-2.0.46 lib/core_extensions/hash.rb
renalware-core-2.0.45 lib/core_extensions/hash.rb
renalware-core-2.0.44 lib/core_extensions/hash.rb
renalware-core-2.0.43 lib/core_extensions/hash.rb
renalware-core-2.0.42 lib/core_extensions/hash.rb
renalware-core-2.0.41 lib/core_extensions/hash.rb