Class: Orange::Middleware::RadiusParser

Inherits:
Base
  • Object
show all
Defined in:
lib/orange-more/slices/middleware/radius_parser.rb

Overview

The RadiusParser middleware will parse all outgoing content with Radius.

For more details on how Radius works, see radius.rubyforge.org/ This middleware also loads a resource: “Orange::Radius”, for the purpose of exposing the context object.

Instance Method Summary collapse

Instance Method Details

#init(opts = {}) ⇒ Object



11
12
13
14
# File 'lib/orange-more/slices/middleware/radius_parser.rb', line 11

def init(opts = {})
  @contexts = opts[:radius_contexts] || [:live]
  # orange.load Orange::Radius.new, :radius
end

#packet_call(packet) ⇒ Object

Passes packet then parses the return



17
18
19
20
21
# File 'lib/orange-more/slices/middleware/radius_parser.rb', line 17

def packet_call(packet)
  pass packet
  orange[:radius].parse packet if @contexts.include? packet['route.context']
  packet.finish
end