Sha256: 92c31d31718601bccd0dd63ff2a827ff12aa6fc03328dbecc9bb5ac991268ad2

Contents?: true

Size: 488 Bytes

Versions: 67

Compression:

Stored size: 488 Bytes

Contents

module Excon
  module Middleware
    class Expects < Excon::Middleware::Base
      def response_call(datum)
        if datum.has_key?(:expects) && ![*datum[:expects]].include?(datum[:response][:status])
          raise(
            Excon::Errors.status_error(
              datum.reject {|key,value| key == :response},
              Excon::Response.new(datum[:response])
            )
          )
        else
          @stack.response_call(datum)
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 4 rubygems

Version Path
excon-0.51.0 lib/excon/middlewares/expects.rb
excon-0.50.1 lib/excon/middlewares/expects.rb
excon-0.50.0 lib/excon/middlewares/expects.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/excon-0.45.4/lib/excon/middlewares/expects.rb
excon-0.49.0 lib/excon/middlewares/expects.rb
excon-0.48.0 lib/excon/middlewares/expects.rb
excon-0.47.0 lib/excon/middlewares/expects.rb
excon-0.46.0 lib/excon/middlewares/expects.rb
framed_rails-0.2.0 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
framed_rails-0.1.7 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/excon-0.45.4/lib/excon/middlewares/expects.rb
framed_rails-0.1.5 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
framed_rails-0.1.4 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
framed_rails-0.1.3 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
framed_rails-0.1.2 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
framed_rails-0.1.0 vendor/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
excon-0.45.4 lib/excon/middlewares/expects.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/excon-0.45.3/lib/excon/middlewares/expects.rb
excon-0.45.3 lib/excon/middlewares/expects.rb
excon-0.45.2 lib/excon/middlewares/expects.rb