Sha256: bcffd101c2963aa81455da2f0a2f0d8636f03781a947f2560c4cbfa530c10acc

Contents?: true

Size: 582 Bytes

Versions: 15

Compression:

Stored size: 582 Bytes

Contents

require 'active_support/core_ext/object/deep_dup'
require 'abstractivator/trees/block_collector'
require 'sourcify'
require 'delegate'
require 'set'

module Abstractivator
  module Trees
    # recursively deletes the specified keys
    def recursive_delete!(hash, keys)
      x = hash # hash is named 'hash' for documentation purposes but may be anything
      case x
        when Hash
          keys.each{|k| x.delete(k)}
          x.each_value{|v| recursive_delete!(v, keys)}
        when Array
          x.each{|v| recursive_delete!(v, keys)}
      end
      x
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
abstractivator-0.4.1 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.4.0 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.3.1 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.3.0 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.2.0 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.1.1 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.1.0 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.31 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.30 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.29 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.28 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.27 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.26 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.25 lib/abstractivator/trees/recursive_delete.rb
abstractivator-0.0.24 lib/abstractivator/trees/recursive_delete.rb