Sha256: dec3e33992d24265a6d413495dc35281c0a8a09182df65c471ea5ddf1762c0bd
Contents?: true
Size: 706 Bytes
Versions: 19
Compression:
Stored size: 706 Bytes
Contents
module Munge module Util class SymbolHash class << self def deep_convert(obj) if obj.is_a?(Hash) convert_hash(obj) elsif obj.is_a?(Array) obj.map do |i| deep_convert(i) end else obj end end private def convert_hash(obj) converted_hash = {} obj.each do |key, value| if key.is_a?(String) || key.is_a?(Symbol) converted_hash[key.to_sym] = deep_convert(value) else converted_hash[key] = value end end converted_hash end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems