lib/pulse-meter/mixins/utils.rb in pulse-meter-client-backport-0.1.0 vs lib/pulse-meter/mixins/utils.rb in pulse-meter-client-backport-0.1.1
- old
+ new
@@ -86,8 +86,23 @@
h
else
item
end
end
+
+ # Symbolizes hash keys
+ def symbolize_keys(h)
+ res = {}
+ h.each do |k, v|
+ new_k = if k.is_a?(String)
+ k.to_sym
+ else
+ k
+ end
+ res[new_k] = v
+ end
+ res
+ end
+
end
end
end