Class: Hash
Instance Method Summary collapse
-
#convert_hash_keys_to_methods(fixture) ⇒ Object
:nodoc:.
-
#key_strings_to_symbols! ⇒ Object
Recursively replace key names that should be symbols with symbols.
Instance Method Details
#convert_hash_keys_to_methods(fixture) ⇒ Object
:nodoc:
2 3 4 |
# File 'lib/extensions/hash.rb', line 2 def convert_hash_keys_to_methods(fixture) # :nodoc: Taza::Entity.new(self,fixture) end |
#key_strings_to_symbols! ⇒ Object
Recursively replace key names that should be symbols with symbols.
7 8 9 10 11 12 13 14 |
# File 'lib/extensions/hash.rb', line 7 def key_strings_to_symbols! result = Hash.new self.each_pair do |key,value| value.key_strings_to_symbols! if value.kind_of? Hash and value.respond_to? :key_strings_to_symbols! result[key.to_sym] = value end self.replace(result) end |