Sha256: 9077edbc2d3c4e1747df1a895bd00b0be1b5bc30bdfed9d0c7482047cdd5ecb2

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true
require 'rack'
require 'proxes/request'

module ProxES
  class Request
    class Stats < ProxES::Request
      attr_reader :index

      def index=(idx)
        @index = idx
        self.path_info = '/' + [ index, endpoint ]
          .map { |v| v.is_a?(Array) ? v.join(',') : v }
          .select { |v| !v.nil? && v != '' }.join('/')
      end

      def endpoint
        '_stats'
      end

      def parse
        @index ||= check_part(path_parts[0])
      end

      def indices?
        true
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proxes-0.2.0 lib/proxes/request/stats.rb
proxes-0.1.0 lib/proxes/request/stats.rb