Sha256: 1cf0d22282277c98785ae367abf5094a9beea093ba031c45a1bdcab201385856
Contents?: true
Size: 593 Bytes
Versions: 9
Compression:
Stored size: 593 Bytes
Contents
module DropboxApi::MiddleWare class Stack def initialize @prependable, @appendable = [], [] end def prepend(&block) @prependable << block end def append(&block) @appendable << block end def adapter=(value) @adapter = value end def apply(connection) @prependable.each { |block| block.yield(connection) } yield connection @appendable.each { |block| block.yield(connection) } # Adapter must be the last middleware configured connection.adapter(@adapter || Faraday.default_adapter) end end end
Version data entries
9 entries across 9 versions & 1 rubygems