Sha256: 6442ccb4caa687e22cf1fad6417b316d01d8d39936a6a57865910c4cac0f12e3

Contents?: true

Size: 499 Bytes

Versions: 20

Compression:

Stored size: 499 Bytes

Contents

module BacklogKit
  class Response
    class Middleware < Faraday::Response::Middleware
      attr_reader(:headers, :status, :body)

      def on_complete(env)
        @headers = env.response_headers
        @status  = env.status
        @body    = env.body
      end

      private

      def no_content?
        status == 204
      end

      def json?
        !!content_type.match(/application\/json/)
      end

      def content_type
        headers['content-type']
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
backlog_kit-0.19.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.18.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.17.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.16.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.15.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.14.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.13.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.12.1 lib/backlog_kit/response/middleware.rb
backlog_kit-0.12.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.11.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.10.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.9.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.8.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.7.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.6.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.5.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.4.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.3.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.2.0 lib/backlog_kit/response/middleware.rb
backlog_kit-0.1.0 lib/backlog_kit/response/middleware.rb