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

- old
+ new

@@ -27,18 +27,17 @@ # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Boolean] :verbose Opt in for more information about the health of the system # @option arguments [Integer] :size Limit the number of affected resources the health API returns # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.12/health-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.13/health-api.html # def health_report(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || "health_report" } + request_opts = { endpoint: arguments[:endpoint] || 'health_report' } - defined_params = [:feature].inject({}) do |set_variables, variable| + defined_params = [:feature].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) || {} @@ -49,10 +48,10 @@ method = Elasticsearch::API::HTTP_GET path = if _feature "_health_report/#{Utils.__listify(_feature)}" else - "_health_report" + '_health_report' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts)