Sha256: 9884d92ea9011568d657c7d2a04c85f6b0e0fa83cff0f3b13c09f3188d0d5fed

Contents?: true

Size: 436 Bytes

Versions: 13

Compression:

Stored size: 436 Bytes

Contents

module Elastic
  module AppSearch
    module Utils
      extend self

      def stringify_keys(hash)
        hash.each_with_object({}) do |(key, value), out|
          out[key.to_s] = value
        end
      end

      def 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
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
elastic-app-search-7.10.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.9.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.8.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.7.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.6.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.5.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.4.1 lib/elastic/app-search/utils.rb
elastic-app-search-7.4.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.3.2 lib/elastic/app-search/utils.rb
elastic-app-search-7.3.1 lib/elastic/app-search/utils.rb
elastic-app-search-7.3.0 lib/elastic/app-search/utils.rb
elastic-app-search-7.2.0 lib/elastic/app-search/utils.rb
elastic-app-search-0.7.0 lib/elastic/app-search/utils.rb