Sha256: 9cf65738bc8ce403f2c5946a80f654c07c592e0c47955a0b4e0188d4cdbffe48

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

# encoding: UTF-8

module Esearch
  class Command
    # Command to check existance of objects
    class Exist < self

      EXPECTED_STATI = [200, 404].freeze

      # Return result
      #
      # @return [true]
      #   if object exists
      #
      # @return [false]
      #   otherwise
      #
      # @api private
      #
      def result
        assert_success
        response.status == 200
      end

    private

      # Return request
      #
      # @return [Request]
      #
      # @api private
      #
      def request
        Request.head(context_path)
      end

    end # Exists
  end # Command
end # Esearch

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.2 lib/esearch/command/exist.rb