Class: Orange::Middleware::Rerouter

Inherits:
Base show all
Defined in:
lib/orange-core/middleware/rerouter.rb

Instance Method Summary collapse

Methods inherited from Base

#call, #initialize, #inspect, #orange, #pass, #recapture

Constructor Details

This class inherits a constructor from Orange::Middleware::Base

Instance Method Details

#init(*args) ⇒ Object



5
6
7
# File 'lib/orange-core/middleware/rerouter.rb', line 5

def init(*args)
  orange.add_pulp Orange::Pulp::Packet_Reroute
end

#packet_call(packet) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/orange-core/middleware/rerouter.rb', line 9

def packet_call(packet)
  begin
    pass packet
  rescue Orange::Reroute
    packet.finish
  end
end