Sha256: e18a3d523bb95beb7e4446c08d22d6a39bddf7b399caf70fd9eeff9556161fa8

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

require 'orange/middleware/base'
module Orange::Middleware
  
  # Middleware to recapture return info and put it back into the
  # packet. Since the Orange::Stack is all middleware, this is
  # important for adding after filters into the orange stack
  # that can interact with the returns of external apps
  class Recapture < Base
    
    def packet_call(packet)
      ret = pass packet
      packet[:status]  = ret[0]
      packet[:headers] = ret[1]
      packet[:content] = ret[2].first
      ret
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
orange-0.0.4 lib/orange/middleware/recapture.rb
orange-0.0.3 lib/orange/middleware/recapture.rb
orange-0.0.2 lib/orange/middleware/recapture.rb