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.84 lib/core_extensions/hash.rb
renalware-core-2.0.83 lib/core_extensions/hash.rb
renalware-core-2.0.82 lib/core_extensions/hash.rb
renalware-core-2.0.81 lib/core_extensions/hash.rb
renalware-core-2.0.80 lib/core_extensions/hash.rb
renalware-core-2.0.79 lib/core_extensions/hash.rb
renalware-core-2.0.78 lib/core_extensions/hash.rb
renalware-core-2.0.77 lib/core_extensions/hash.rb
renalware-core-2.0.76 lib/core_extensions/hash.rb
renalware-core-2.0.75 lib/core_extensions/hash.rb
renalware-core-2.0.74 lib/core_extensions/hash.rb
renalware-core-2.0.73 lib/core_extensions/hash.rb
renalware-core-2.0.72 lib/core_extensions/hash.rb
renalware-core-2.0.71 lib/core_extensions/hash.rb
renalware-core-2.0.70 lib/core_extensions/hash.rb
renalware-core-2.0.69 lib/core_extensions/hash.rb
renalware-core-2.0.68 lib/core_extensions/hash.rb
renalware-core-2.0.67 lib/core_extensions/hash.rb
renalware-core-2.0.64 lib/core_extensions/hash.rb
renalware-core-2.0.63 lib/core_extensions/hash.rb