Module: Elasticsearch::DSL::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/elasticsearch/dsl/utils.rb

Overview

Generic utility methods

Instance Method Summary collapse

Instance Method Details

#__camelize(string) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Camelize an underscored string

A lightweight version of ActiveSupport’s ‘camelize`

Examples:

__camelize('query_string')
# => 'QueryString'


35
36
37
# File 'lib/elasticsearch/dsl/utils.rb', line 35

def __camelize(string)
  string.to_s.split('_').map(&:capitalize).join
end