Module: BMO::Utils
- Defined in:
- lib/bmo/utils.rb
Overview
Utility module
Class Method Summary collapse
-
.coerce_to_symbols(hash) ⇒ Object
Coerce string hash keys to symbols.
Class Method Details
.coerce_to_symbols(hash) ⇒ Object
Coerce string hash keys to symbols
6 7 8 9 10 11 12 13 |
# File 'lib/bmo/utils.rb', line 6 def self.coerce_to_symbols(hash) hash_symbolized = {} hash.each_pair do |key, value| key = key.to_sym if key.respond_to?(:to_sym) hash_symbolized[key] = value end hash_symbolized end |