module KeyMirror

Constants

VERSION

Public Class Methods

call(hash) click to toggle source
# File lib/key_mirror.rb, line 18
def self.call(hash)
  raise KeyMirror::ArgumentError.new unless hash.is_a?(Hash)

  hash.each do |key, _|
    raise KeyMirror::KeyError unless key.is_a?(String) || key.is_a?(Symbol)

    hash[key] = key.to_s
  end

  hash
end