Module: OpenSearch::DSL::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/opensearch/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'


42
43
44
# File 'lib/opensearch/dsl/utils.rb', line 42

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