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'


22
23
24
# File 'lib/elasticsearch/dsl/utils.rb', line 22

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