Sha256: d6645f9da1e5b432a044deea86224012327715db0565f3a2f27014b3e0a132aa

Contents?: true

Size: 477 Bytes

Versions: 20

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true
require 'delegate'

# ProxyRb
module ProxyRb
  # An HTTP request
  class Request < SimpleDelegator
    # Was the request successful
    #
    # @return [TrueClass, FalseClass]
    #   The result
    def successful?
      __getobj__.status_code.to_s.start_with?('2', '3')
    end

    # The request is forbidden
    #
    # @return [TrueClass, FalseClass]
    #   The result
    def forbidden?
      __getobj__.status_code == 403
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
proxy_rb-1.0.0 lib/proxy_rb/request.rb
proxy_rb-0.10.6 lib/proxy_rb/request.rb
proxy_rb-0.10.5 lib/proxy_rb/request.rb
proxy_rb-0.10.4 lib/proxy_rb/request.rb
proxy_rb-0.10.3 lib/proxy_rb/request.rb
proxy_rb-0.10.2 lib/proxy_rb/request.rb
proxy_rb-0.10.1 lib/proxy_rb/request.rb
proxy_rb-0.10.0 lib/proxy_rb/request.rb
proxy_rb-0.9.3 lib/proxy_rb/request.rb
proxy_rb-0.9.2 lib/proxy_rb/request.rb
proxy_rb-0.9.1 lib/proxy_rb/request.rb
proxy_rb-0.9.0 lib/proxy_rb/request.rb
proxy_rb-0.8.3 lib/proxy_rb/request.rb
proxy_rb-0.8.2 lib/proxy_rb/request.rb
proxy_rb-0.8.1 lib/proxy_rb/request.rb
proxy_rb-0.8.0 lib/proxy_rb/request.rb
proxy_rb-0.7.1 lib/proxy_rb/request.rb
proxy_rb-0.7.0 lib/proxy_rb/request.rb
proxy_rb-0.6.0 lib/proxy_rb/request.rb
proxy_rb-0.5.0 lib/proxy_rb/request.rb