Sha256: d924858ca480d1033e632f32ccd39372ca90597faff55c614cb27539180aed10

Contents?: true

Size: 467 Bytes

Versions: 85

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

require 'delegate'

module HTTParty
  # Allow access to http_response and code by delegation on fragment
  class ResponseFragment < SimpleDelegator
    attr_reader :http_response, :connection

    def code
      @http_response.code.to_i
    end

    def initialize(fragment, http_response, connection)
      @fragment = fragment
      @http_response = http_response
      @connection = connection
      super fragment
    end
  end
end

Version data entries

85 entries across 85 versions & 3 rubygems

Version Path
harbr-0.1.59 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.58 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.57 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.56 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.55 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.54 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.53 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.52 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.50 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.49 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.48 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.47 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.46 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.45 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.44 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.43 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.42 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.41 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.39 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb
harbr-0.1.38 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/lib/httparty/response_fragment.rb