Module: Aitch::Utils
Instance Method Summary collapse
Instance Method Details
#build_query(data) ⇒ Object
20 21 22 |
# File 'lib/aitch/utils.rb', line 20 def build_query(data) data.to_query end |
#symbolize_keys(hash) ⇒ Object
14 15 16 17 18 |
# File 'lib/aitch/utils.rb', line 14 def symbolize_keys(hash) hash.each_with_object({}) do |(key, value), buffer| buffer[key.to_sym] = value end end |
#underscore(string) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/aitch/utils.rb', line 6 def underscore(string) string = string.gsub(/(?<=.)(URI|[A-Z])/) do |char| "_#{char}" end string.downcase end |