Class: Rack::AMF::Middleware::ServiceManager

Inherits:
Object
  • Object
show all
Includes:
Rack::AMF::Middleware
Defined in:
lib/rack/amf/middleware/service_manager.rb

Overview

Internal AMF handler, it uses the ServiceManager to handle request service mapping.

Constant Summary

Constants included from Rack::AMF::Middleware

APPLICATION_AMF

Instance Method Summary collapse

Methods included from Rack::AMF::Middleware

#call, #should_handle?

Constructor Details

#initialize(app, options = {}) ⇒ ServiceManager

Returns a new instance of ServiceManager.



10
11
12
13
# File 'lib/rack/amf/middleware/service_manager.rb', line 10

def initialize app, options={}
  @app = app
  Rack::AMF::Environment.populate options
end

Instance Method Details

#handle(env) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rack/amf/middleware/service_manager.rb', line 15

def handle env
  req = env['rack-amf.request']
  res = env['rack-amf.response']

  logger = ::Logger.new(env['rack.errors'])
  res.each_method_call req do |method, args|
    handle_method method, args, logger
  end
end