Sha256: 4eb96c125a62c93b0cf15e8e41b97bd85007c49cf362d8cb99a025360d5141a6

Contents?: true

Size: 735 Bytes

Versions: 4

Compression:

Stored size: 735 Bytes

Contents

# frozen_string_literal: true

require 'proxes/request'
require 'proxes/policies/request/stats_policy'

module ProxES
  class Request
    class Stats < Request
      attr_reader :index

      def index=(idx)
        @index = idx
        self.path_info = '/' + [index, endpoint].compact
                                                .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 stats
        @stats ||= check_part(path_parts[2])
      end

      def indices?
        true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proxes-0.9.13 lib/proxes/request/stats.rb
proxes-0.9.12 lib/proxes/request/stats.rb
proxes-0.9.9 lib/proxes/request/stats.rb
proxes-0.9.7 lib/proxes/request/stats.rb