Sha256: 8a1f78c59a2d2503a7332e4242e5da45f15184254b3a21d9b29c5de8dfa83fe1
Contents?: true
Size: 756 Bytes
Versions: 13
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true require 'proxes/request' require 'proxes/policies/request/index_policy' module ProxES class Request class Index < Request attr_reader :index, :type, :id def index=(idx) @index = idx self.path_info = '/' + [index, type, id].compact .map { |v| v.is_a?(Array) ? v.join(',') : v } .select { |v| !v.nil? && v != '' }.join('/') end def endpoint nil end def parse @index ||= check_part(path_parts[0]) @type ||= check_part(path_parts[1]) @id ||= check_part(path_parts[2]) end def indices? true end end end end
Version data entries
13 entries across 13 versions & 1 rubygems