Sha256: 690ee3388c7e5a8f06ad769d90dea4b5fe02d0a20e441cabbb1bc97fd25ea758

Contents?: true

Size: 361 Bytes

Versions: 36

Compression:

Stored size: 361 Bytes

Contents

module Schemacop::V2
  class Dupper
    def self.dup_data(data)
      if data.is_a?(Hash)
        data = data.dup

        data.each do |key, value|
          data[key] = dup_data(value)
        end

        return data
      elsif data.is_a?(Array)
        return data.map { |value| dup_data(value) }
      else
        return data
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
schemacop-3.0.29 lib/schemacop/v2/dupper.rb
schemacop-3.0.28 lib/schemacop/v2/dupper.rb
schemacop-3.0.27 lib/schemacop/v2/dupper.rb
schemacop-3.0.26 lib/schemacop/v2/dupper.rb
schemacop-3.0.25 lib/schemacop/v2/dupper.rb
schemacop-3.0.24 lib/schemacop/v2/dupper.rb
schemacop-3.0.23 lib/schemacop/v2/dupper.rb
schemacop-3.0.22 lib/schemacop/v2/dupper.rb
schemacop-3.0.21 lib/schemacop/v2/dupper.rb
schemacop-3.0.20 lib/schemacop/v2/dupper.rb
schemacop-3.0.19 lib/schemacop/v2/dupper.rb
schemacop-3.0.18 lib/schemacop/v2/dupper.rb
schemacop-3.0.17 lib/schemacop/v2/dupper.rb
schemacop-3.0.16 lib/schemacop/v2/dupper.rb
schemacop-3.0.15 lib/schemacop/v2/dupper.rb
schemacop-3.0.14 lib/schemacop/v2/dupper.rb
schemacop-3.0.13 lib/schemacop/v2/dupper.rb
schemacop-3.0.12 lib/schemacop/v2/dupper.rb
schemacop-3.0.11 lib/schemacop/v2/dupper.rb
schemacop-3.0.10 lib/schemacop/v2/dupper.rb