Class: Ur::Faraday::YieldUr

Inherits:
Ur::FaradayMiddleware show all
Defined in:
lib/ur/faraday/yield_ur.rb

Overview

Faraday middleware which yields an Ur to the given block

Instance Attribute Summary

Attributes included from Middleware

#app, #options

Instance Method Summary collapse

Methods inherited from Ur::FaradayMiddleware

#call

Methods included from Middleware

#begin_request, #finish_request, #invoke_callback

Constructor Details

#initialize(app, **options, &block) ⇒ YieldUr

Returns a new instance of YieldUr.

Raises:

  • (ArgumentError)


7
8
9
10
# File 'lib/ur/faraday/yield_ur.rb', line 7

def initialize(app, **options, &block)
  raise(ArgumentError, "no block given to yield ur") unless block
  super(app, options.merge(after_response: block))
end