lib/elasticsearch/api/actions/indices/flush.rb in elasticsearch-api-0.4.0 vs lib/elasticsearch/api/actions/indices/flush.rb in elasticsearch-api-0.4.1

- old
+ new

@@ -18,19 +18,19 @@ # @option arguments [Boolean] :refresh Refresh the index after performing the operation # # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-flush/ # def flush(arguments={}) + valid_params = [ + :force, + :full, + :ignore_indices, + :refresh ] + method = 'POST' - path = Utils.__pathify( Utils.__listify(arguments[:index]), '_flush' ) - params = arguments.select do |k,v| - [ :force, - :full, - :ignore_indices, - :refresh ].include?(k) - end - # Normalize Ruby 1.8 and Ruby 1.9 Hash#select behaviour - params = Hash[params] unless params.is_a?(Hash) + path = Utils.__pathify Utils.__listify(arguments[:index]), '_flush' + + params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end end