Sha256: 5d666c626f7f5ad716f7d6994de37bb0395191ff58acf19b301438b3372652a8

Contents?: true

Size: 294 Bytes

Versions: 1

Compression:

Stored size: 294 Bytes

Contents

require "freeze_all/version"

module FreezeAll
  def freeze_all
    if is_a?(Array)
      each(&:freeze).freeze
    elsif is_a?(Hash)
      each do |key, val|
        key.freeze
        val.freeze
      end
      freeze
    else
    end
  end
end

Array.include FreezeAll
Hash.include FreezeAll

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freeze_all-0.1.0 lib/freeze_all.rb