Class: Hash
Instance Method Summary collapse
Instance Method Details
#alter_keys ⇒ Object
2 3 4 5 6 7 |
# File 'lib/right_resource/core_ext/hash/alter_keys.rb', line 2 def alter_keys attrs = {} self.each_pair {|key,value| attrs[key.to_s.gsub('-', '_').to_sym] = value} self.clear.merge!(attrs).rehash if attrs self end |