module Lol
Constants
- VERSION
Public Class Methods
underscore_hash_keys(hash)
click to toggle source
Takes a hash and returns a copy of it with the keys that have been underscored This method is here but should be somewhere else, probably an helper module @param [Hash] a hash with keys in camelCase format @return [Hash] a copy of the original hash, with hash keys that have been underscored
# File lib/lol.rb, line 12 def self.underscore_hash_keys hash hash.inject({}) { |memo, (key, value)| memo.update key.to_s.underscore => value } end