The implementation of the copland.webrick.ResultHandlers service. This manages a collection of result handlers for the WWWRPCServletFactory service. Whenever an invoked service returns a value, the WWWRPCServlet will pass the result through this service to convert the value to something that can be returned to the user.
Methods
Classes and Modules
Class Copland::WEBrick::ResultHandlers::HandlerOrderingWrapperPublic Class methods
Create a new ResultHandlers instance from the given array of handler definitions. The list will be ordered based on each handler’s before and after preferences.
[ show source ]
# File lib/copland/webrick/result-handlers.rb, line 90
90: def initialize( handlers )
91: @handlers = Copland::Orderer.order(
92: handlers.map { |h| HandlerOrderingWrapper.new( h ) }
93: ).map { |h| h.handler }
94: end
Public Instance methods
Attempt to handle the given data by passing it, in turn, to each registered handler. Return true if the data was handled, and false if it was not.
[ show source ]
# File lib/copland/webrick/result-handlers.rb, line 99
99: def handle( data, request, response )
100: @handlers.each do |handler|
101: return true if handler.handle( data, request, response )
102: end
103:
104: return false
105: end