Sha256: 1ced6b069284c2b43d5397093800aaf67dbaf636bd5bfa062c6a311cfd883a66

Contents?: true

Size: 413 Bytes

Versions: 14

Compression:

Stored size: 413 Bytes

Contents

module Chronicle
  module ETL
    module Utils
      module HashUtilities
        def self.flatten_hash(hash)
          hash.each_with_object({}) do |(k, v), h|
            if v.is_a? Hash
              flatten_hash(v).map do |h_k, h_v|
                h["#{k}.#{h_k}".to_sym] = h_v
              end
            else 
              h[k] = v
            end
           end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chronicle-etl-0.5.5 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.5.4 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.5.3 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.5.2 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.5.1 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.5.0 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.4.4 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.4.3 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.4.2 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.4.1 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.4.0 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.3.1 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.3.0 lib/chronicle/etl/utils/hash_utilities.rb
chronicle-etl-0.2.4 lib/chronicle/etl/utils/hash_utilities.rb