Sha256: 112852a0c0b9b823362d4eb79b912b1e0e417ef9580f7ffaee127501e5b61cc9

Contents?: true

Size: 545 Bytes

Versions: 63

Compression:

Stored size: 545 Bytes

Contents

# encoding: utf-8

require 'faraday'

module Github
  # 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 # Github

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
github_api-0.13.0 lib/github_api/response.rb
github_api-0.12.4 lib/github_api/response.rb
github_api-0.12.3 lib/github_api/response.rb
github_api-0.12.2 lib/github_api/response.rb
github_api-0.12.1 lib/github_api/response.rb
github_api-0.12.0 lib/github_api/response.rb
github_api-0.11.3 lib/github_api/response.rb
github_api-0.11.2 lib/github_api/response.rb
github_api-0.11.1 lib/github_api/response.rb
github_api-0.11.0 lib/github_api/response.rb
github_api-0.10.2 lib/github_api/response.rb
github_api-0.10.1 lib/github_api/response.rb
github_api-0.10.0 lib/github_api/response.rb
github_api-0.9.7 lib/github_api/response.rb
github_api-0.9.6 lib/github_api/response.rb
github_api-0.9.5 lib/github_api/response.rb
github_api-0.9.4 lib/github_api/response.rb
github_api-0.9.3 lib/github_api/response.rb
github_api-0.9.2 lib/github_api/response.rb
github_api-0.9.1 lib/github_api/response.rb