Sha256: baf91ec2f58534f4f6c18ba63dbad52a474e7c522c1aa021bc15ad9beed23d3a

Contents?: true

Size: 550 Bytes

Versions: 21

Compression:

Stored size: 550 Bytes

Contents

# encoding: utf-8

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'.freeze

    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

21 entries across 21 versions & 5 rubygems

Version Path
codenamev_bitbucket_api-0.4.1 lib/bitbucket_rest_api/response.rb
codenamev_bitbucket_api-0.4.0 lib/bitbucket_rest_api/response.rb
zz_bitbucket_rest_api-0.1.11 lib/bitbucket_rest_api/response.rb
zz_bitbucket_rest_api-0.1.10 lib/bitbucket_rest_api/response.rb
zz_bitbucket_rest_api-0.1.9 lib/bitbucket_rest_api/response.rb
zz_bitbucket_rest_api-0.1.8 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api2-0.9.5 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api2-0.9.1 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api2-0.2.2 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api2-0.2.1 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api2-0.2.0 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api-0.1.7 lib/bitbucket_rest_api/response.rb
reenhanced_bitbucket_api-0.3.2 lib/bitbucket_rest_api/response.rb
reenhanced_bitbucket_api-0.3.1 lib/bitbucket_rest_api/response.rb
reenhanced_bitbucket_api-0.3.0 lib/bitbucket_rest_api/response.rb
reenhanced_bitbucket_api-0.1.6 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api-0.1.5 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api-0.1.4 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api-0.1.2 lib/bitbucket_rest_api/response.rb
bitbucket_rest_api-0.1.1 lib/bitbucket_rest_api/response.rb