module TimestampAPI::Utils

Public Instance Methods

camelize(symbol) click to toggle source
# File lib/timestamp_api/utils.rb, line 3
def camelize(symbol)
  symbol.to_s.split('_').each_with_index.map{ |chunk, idx| idx == 0 ? chunk : chunk.capitalize }.join.gsub(/^\w/, &:downcase)
end
camelize_keys(hash) click to toggle source
# File lib/timestamp_api/utils.rb, line 7
def camelize_keys(hash)
  hash.each_with_object({}) { |pair, acc| acc[camelize(pair[0])] = pair[1] }
end