Sha256: d5453bb46cf2820bee118c77adb914c5a4ff2100400d8ed45af9191dcd48df99

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true
require 'faraday'

module BitBucket
  # Contains methods and attributes that act on the response returned from the
  # request
  class Response < Faraday::Response::Middleware
    CONTENT_TYPE = 'Content-Type'

    class << self
      attr_accessor :parser
    end

    def self.define_parser(&block)
      @parser = block
    end

    def response_type(env)
      env[:response_headers][CONTENT_TYPE].to_s
    end

    def parse_response?(env)
      env[:body].respond_to? :to_str
    end
  end # Response
end # BitBucket

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitbuckets-0.2.0 lib/bitbucket_rest_api/response.rb