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.104 lib/core_extensions/hash.rb
renalware-core-2.0.103 lib/core_extensions/hash.rb
renalware-core-2.0.102 lib/core_extensions/hash.rb
renalware-core-2.0.101 lib/core_extensions/hash.rb
renalware-core-2.0.100 lib/core_extensions/hash.rb
renalware-core-2.0.99 lib/core_extensions/hash.rb
renalware-core-2.0.98 lib/core_extensions/hash.rb
renalware-core-2.0.97 lib/core_extensions/hash.rb
renalware-core-2.0.96 lib/core_extensions/hash.rb
renalware-core-2.0.95 lib/core_extensions/hash.rb
renalware-core-2.0.94 lib/core_extensions/hash.rb
renalware-core-2.0.93 lib/core_extensions/hash.rb
renalware-core-2.0.92 lib/core_extensions/hash.rb
renalware-core-2.0.91 lib/core_extensions/hash.rb
renalware-core-2.0.90 lib/core_extensions/hash.rb
renalware-core-2.0.89 lib/core_extensions/hash.rb
renalware-core-2.0.88 lib/core_extensions/hash.rb
renalware-core-2.0.87 lib/core_extensions/hash.rb
renalware-core-2.0.86 lib/core_extensions/hash.rb
renalware-core-2.0.85 lib/core_extensions/hash.rb