Sha256: 1936451a6ec26c66e9dca8b330dfab6594dbf1a1977f1e2aeef8737f1932804a

Contents?: true

Size: 288 Bytes

Versions: 2

Compression:

Stored size: 288 Bytes

Contents

# frozen_string_literal: true

class CaseInsensitiveHash < Hash
  def initialize(hash = {})
    super
    hash.each do |key, value|
      self[key.downcase] = value
    end
  end

  def [](key)
    super(key.downcase)
  end

  def []=(key, value)
    super(key.downcase, value)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-audioinfo-0.5.5 lib/audioinfo/case_insensitive_hash.rb
ruby-audioinfo-0.5.4 lib/audioinfo/case_insensitive_hash.rb