Sha256: c94b10a6d29165a9d3a9488367c03c9523bcce3eb6539700a75d13e45558e4a6

Contents?: true

Size: 817 Bytes

Versions: 1

Compression:

Stored size: 817 Bytes

Contents

# frozen_string_literal: true

module Acfs
  class Response
    # Method to fetch information about response status.
    #
    module Status
      # Return response status code. Will return zero if
      # request was not executed or failed on client side.
      #
      def status_code
        @status.to_i if defined?(@status)
        # return response.response_code unless response.nil?
        # 0
      end
      alias code status_code

      # Return true if response was successful indicated by
      # response status code.
      #
      def success?
        code >= 200 && code < 300
      end

      # Return true unless response status code indicates that
      # resource was not modified according to send precondition headers.
      #
      def modified?
        code != 304
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acfs-2.0.0 lib/acfs/response/status.rb