module Elastic::EnterpriseSearch::Utils

Util functions

Constants

DEFAULT_HOST

Public Class Methods

symbolize_keys(hash) click to toggle source
# File lib/elastic/enterprise-search/utils.rb, line 34
def self.symbolize_keys(hash)
  hash.each_with_object({}) do |(key, value), out|
    new_key = key.respond_to?(:to_sym) ? key.to_sym : key
    out[new_key] = value
  end
end

Public Instance Methods

stringify_keys(hash) click to toggle source
# File lib/elastic/enterprise-search/utils.rb, line 26
def stringify_keys(hash)
  output = {}
  hash.each do |key, value|
    output[key.to_s] = value
  end
  output
end