Method: Elasticsearch::API::Utils#__listify
- Defined in:
- lib/elasticsearch/api/utils.rb
permalink #__listify(*list) ⇒ 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.
Create a “list” of values from arguments, ignoring nil values and encoding special characters.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch/api/utils.rb', line 51 def __listify(*list) = list.last.is_a?(Hash) ? list.pop : {} escape = [:escape] Array(list). flat_map { |e| e.respond_to?(:split) ? e.split(',') : e }. flatten. compact. map { |e| escape == false ? e : __escape(e) }. join(',') end |