Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/chatterbot.rb
Overview
extend Hash class to turn keys into symbols
Instance Method Summary collapse
-
#symbolize_keys! ⇒ Object
turn keys in this hash into symbols.
Instance Method Details
#symbolize_keys! ⇒ Object
turn keys in this hash into symbols
14 15 16 17 18 19 |
# File 'lib/chatterbot.rb', line 14 def symbolize_keys! replace(inject({}) do |hash,(key,value)| hash[key.to_sym] = value.is_a?(Hash) ? value.symbolize_keys! : value hash end) end |