lib/elasticsearch/api/actions/cat/recovery.rb in elasticsearch-api-8.12.2 vs lib/elasticsearch/api/actions/cat/recovery.rb in elasticsearch-api-8.13.0

- old
+ new

@@ -34,18 +34,17 @@ # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) # @option arguments [Boolean] :v Verbose mode. Display column headers # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cat-recovery.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.13/cat-recovery.html # def recovery(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || "cat.recovery" } + request_opts = { endpoint: arguments[:endpoint] || 'cat.recovery' } - defined_params = [:index].inject({}) do |set_variables, variable| + defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -56,10 +55,10 @@ method = Elasticsearch::API::HTTP_GET path = if _index "_cat/recovery/#{Utils.__listify(_index)}" else - "_cat/recovery" + '_cat/recovery' end params = Utils.process_params(arguments) params[:h] = Utils.__listify(params[:h]) if params[:h] Elasticsearch::API::Response.new(