Subversion Info

Rev
437
Last Checked In
2008-03-28 00:49:20 (2 weeks ago)
Checked in by
deveiant

Parent

Class Index

Quicksearch

Arrow::Dispatcher

A mod_ruby handler class for dispatching requests to an Arrow web application.

Constants

SVNRev
SVN Revision
SVNId
SVN Id

Attributes

name[R]
The key used to indentify this dispatcher

Public Class Methods

create( configspec ) click to toggle source

Set up one or more new Arrow::Dispatcher objects. The configspec argument can either be the path to a config file, or a hash of config files. See the .instance method for more about how to use this method.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 127
127:     def self::create( configspec )
128: 
129:         # Normalize configurations. Expected either a configfile path in a
130:         # String, or a Hash of configfiles
131:         case configspec
132:         when String
133:             configs = { :__default__ => configspec }
134:         when Hash
135:             configs = configspec
136:         else
137:             raise ArgumentError, "Invalid config hash %p" % [configspec]
138:         end
139: 
140:         # Create the dispatchers and return the first one to support the
141:         # old-style create, i.e.,
142:         #   dispatcher = Arrow::Dispatcher.create( configfile )
143:         @@Instance = create_configured_dispatchers( configs )
144:         @@Instance.values.first
145:     rescue ::Exception => err
146: 
147:         # Try to log fatal errors to both the Apache server log and a crashfile
148:         # before passing the exception along.
149:         errmsg = "%s failed to start (%s): %s: %s" % [
150:             self.name,
151:             err.class.name,
152:             err.message,
153:             err.backtrace.join("\n  ")
154:         ]
155: 
156:         logfile = File.join( Dir.tmpdir, "arrow-fatal.log.#{$$}" )
157:         File.open( logfile, IO::WRONLY|IO::TRUNC|IO::CREAT ) {|ofh|
158:             ofh.puts( errmsg )
159:             ofh.flush
160:         }
161: 
162:         if defined?( Apache )
163:             Apache.request.server.log_crit( errmsg )
164:         end
165: 
166:         Kernel.raise( err )
167:     end
create_configured_dispatchers( configspec ) click to toggle source

Create dispatchers for the config files given in configspec and return them in a Hash keyed by both the configname key and the expanded path to the configuration file.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 198
198:     def self::create_configured_dispatchers( configspec )
199:         instances = {}
200: 
201:         # Load a dispatcher for each config
202:         configspec.each do |key, configfile|
203: 
204:             # Normalize the path to the config file and make sure it's not
205:             # loaded yet. If it is, link it to the current key and skip to the
206:             # next.
207:             configfile = File.expand_path( configfile )
208:             if instances.key?( configfile )
209:                 instances[ key ] = instances[ configfile ]
210:                 next
211:             end
212: 
213:             # If a config file is given, load it. If it's not, just use the
214:             # default config.
215:             if configfile
216:                 config = Arrow::Config.load( configfile )
217:             else
218:                 config = Arrow::Config.new
219:             end
220: 
221:             # Create a dispatcher and put it in the table by both its key and
222:             # the normalized path to its configfile.
223:             instances[ key ] = instances[ configfile ] = new( key, config )
224:         end
225: 
226:         return instances
227:     end
create_from_hosts_file( hosts_file ) click to toggle source

Create one or more dispatchers from the specified hosts_file, which is a YAML file that maps arrow configurations onto a symbol that can be used to refer to it.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 173
173:     def self::create_from_hosts_file( hosts_file )
174:         configs = nil
175: 
176:         if hosts_file.respond_to?( :read )
177:             configs = YAML.load( hosts_file.read ) 
178:         else
179:             hosts_file.untaint
180:             configs = YAML.load_file( hosts_file )
181:         end
182: 
183:         # Convert the keys to Symbols and the values to untainted Strings.
184:         configs.each do |key,config|
185:             sym = key.to_s.dup.untaint.to_sym
186:             configs[ sym ] = configs.delete( key )
187:             configs[ sym ].untaint
188:         end
189: 
190:         @@Instance = self.create_configured_dispatchers( configs )
191:         return @@Instance
192:     end
instance( key=:__default__ ) click to toggle source

Get the instance of the Dispatcher set up under the given key, which can either be a Symbol or a String containing the path to a configfile. If no key is given, it defaults to :default, which is the key assigned when .create is given just a configfile argument.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 103
103:     def self::instance( key=:__default__ )
104:         rval = nil
105: 
106:         # Fetch the instance which corresponds to the given key
107:         if key.is_a?( Symbol )
108:             Arrow::Logger.debug "Returning instance for key %p (one of %p): %p" %
109:                 [key, @@Instance.keys, @@Instance[key]]
110:             rval = @@Instance[ key ]
111:         else
112:             Arrow::Logger.debug "Returning instance for configfile %p" % [key]
113:             configfile = File.expand_path( key )
114:             self.create( configfile )
115:             rval = @@Instance[ configfile ]
116:         end
117: 
118:         # Return either a configured Dispatcher instance or a FallbackHandler if
119:         # no Dispatcher corresponds to the given key.
120:         return rval || Arrow::FallbackHandler.new( key, @@Instance )
121:     end
new( name, config ) click to toggle source

Set up an Arrow::Dispatcher object based on the specified config (an Arrow::Config object).

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 236
236:     def initialize( name, config )
237:         @name = name
238:         @config = config
239:         @broker = Arrow::Broker.new( config )
240: 
241:         self.configure( config )
242:     rescue ::Exception => err
243:         msg = "%s while creating dispatcher: %s\n%s" %
244:             [ err.class.name, err.message, err.backtrace.join("\n\t") ]
245:         self.log.error( msg )
246:         msg.gsub!( /%/, '%%' )
247:         Apache.request.server.log_crit( msg ) unless !defined?( Apache )
248:     end

Public Instance Methods

child_init( req ) click to toggle source

Child init mod_ruby handler

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 275
275:     def child_init( req ) # :nodoc
276:         self.log.notice "Dispatcher configured for %s" % [ req.server.hostname ]
277:         return Apache::OK
278:     end
configure( config ) click to toggle source

(Re)configure the dispatcher based on the values in the given config (an Arrow::Config object).

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 261
261:     def configure( config )
262: 
263:         self.log.notice "Configuring a dispatcher for '%s' from '%s': child server %d" %
264:             [ Apache.request.server.hostname, config.name, Process.pid ]
265: 
266:         # Configure any modules that have mixed in Arrow::Configurable
267:         Arrow::Configurable.configure_modules( config, self )
268: 
269:     end
handler( req ) click to toggle source

The content handler method. Dispatches requests to registered applets based on the requests PATH_INFO.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 283
283:     def handler( req )
284:         self.log.info "--- Dispatching request %p ---------------" % [req]
285:         self.log.debug "Request headers are: %s" % [untable(req.headers_in)]
286: 
287:         if (( reason = @config.changed_reason ))
288:             self.log.notice "** Reloading configuration: #{reason} ***"
289:             @config.reload
290:             @broker = Arrow::Broker.new( @config )
291:             self.configure( @config )
292:         end
293: 
294:         if ! @broker
295:             self.log.error "Fatal: No broker."
296:             return Apache::SERVER_ERROR
297:         end
298: 
299:         txn = Arrow::Transaction.new( req, @config, @broker )
300: 
301:         self.log.debug "Delegating transaction %p" % [txn]
302:         unless output = @broker.delegate( txn )
303:             self.log.info "Declining transaction (Applets returned: %p)" % output
304:             return Apache::DECLINED
305:         end
306: 
307:         # If the transaction succeeded, set up the Apache::Request object, add
308:         # headers, add session state, etc. If it failed, log the failure and let
309:         # the status be returned as-is.
310:         response_body = nil
311:         self.log.debug "Transaction has status %d" % [txn.status]
312: 
313:         # Render the output before anything else, as there might be
314:         # session/header manipulation left to be done somewhere in the
315:         # render. If the response is true, the applets have handled output
316:         # themselves.
317:         if output && output != true
318:             rendertime = Benchmark.measure do
319:                 response_body = output.to_s
320:             end
321:             self.log.debug "Output render time: %s" %
322:                 rendertime.format( '%8.4us usr %8.4ys sys %8.4ts wall %8.4r' )
323:             req.headers_out['content-length'] = response_body.length.to_s unless
324:                 req.headers_out['content-length']
325:         end
326: 
327:         # If the transaction has a session, save it
328:         txn.session.save if txn.session?
329: 
330:         # Add cookies to the response headers
331:         txn.add_cookie_headers
332: 
333:         self.log.debug "HTTP response status is: %d" % [txn.status]
334:         self.log.debug "Response headers were: %s" % [untable(req.headers_out)]
335:         txn.send_http_header
336:         txn.print( response_body ) if response_body
337: 
338:         self.log.info "--- Done with request %p (%s)---------------" % 
339:             [ req, req.status_line ]
340: 
341:         req.sync = true
342:         return txn.handler_status
343:     rescue ::Exception => err
344:         self.log.error "Dispatcher caught an unhandled %s: %s:\n\t%s" %
345:             [ err.class.name, err.message, err.backtrace.join("\n\t") ]
346:         return Apache::SERVER_ERROR
347: 
348:     ensure
349:         # Make sure session locks are released
350:         txn.session.finish if txn && txn.session?
351:     end
inspect() click to toggle source

Return a human-readable representation of the receiver as a String.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 355
355:     def inspect
356:         return "#<%s:0x%x config: %s>" % [
357:             self.class.name,
358:             self.object_id,
359:             @config.name,
360:         ]
361:     end
untable( table ) click to toggle source

(Not documented)

     # File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 364
364:     def untable( table )
365:         lines = []
366:         table.each do |k,v|
367:             lines << "%s: %s" % [ k, v ]
368:         end
369:         
370:         return lines.join( "; " )
371:     end

secsequence

--- SEC00047

seccomment

--- ""

attributes

--- 
- name: name
  rw: R
  a_desc: |+
    
    The key used to indentify this dispatcher
    

method_list

--- 
- methods: 
  - visibility: public
    aref: M000435
    name: create
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 127</span>\n\
      127:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">create</span>( <span class=\"ruby-identifier\">configspec</span> )\n\
      128: \n\
      129:         <span class=\"ruby-comment cmt\"># Normalize configurations. Expected either a configfile path in a</span>\n\
      130:         <span class=\"ruby-comment cmt\"># String, or a Hash of configfiles</span>\n\
      131:         <span class=\"ruby-keyword kw\">case</span> <span class=\"ruby-identifier\">configspec</span>\n\
      132:         <span class=\"ruby-keyword kw\">when</span> <span class=\"ruby-constant\">String</span>\n\
      133:             <span class=\"ruby-identifier\">configs</span> = { <span class=\"ruby-identifier\">:__default__</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">configspec</span> }\n\
      134:         <span class=\"ruby-keyword kw\">when</span> <span class=\"ruby-constant\">Hash</span>\n\
      135:             <span class=\"ruby-identifier\">configs</span> = <span class=\"ruby-identifier\">configspec</span>\n\
      136:         <span class=\"ruby-keyword kw\">else</span>\n\
      137:             <span class=\"ruby-identifier\">raise</span> <span class=\"ruby-constant\">ArgumentError</span>, <span class=\"ruby-value str\">&quot;Invalid config hash %p&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">configspec</span>]\n\
      138:         <span class=\"ruby-keyword kw\">end</span>\n\
      139: \n\
      140:         <span class=\"ruby-comment cmt\"># Create the dispatchers and return the first one to support the</span>\n\
      141:         <span class=\"ruby-comment cmt\"># old-style create, i.e.,</span>\n\
      142:         <span class=\"ruby-comment cmt\">#   dispatcher = Arrow::Dispatcher.create( configfile )</span>\n\
      143:         <span class=\"ruby-ivar\">@@Instance</span> = <span class=\"ruby-identifier\">create_configured_dispatchers</span>( <span class=\"ruby-identifier\">configs</span> )\n\
      144:         <span class=\"ruby-ivar\">@@Instance</span>.<span class=\"ruby-identifier\">values</span>.<span class=\"ruby-identifier\">first</span>\n\
      145:     <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Exception</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      146: \n\
      147:         <span class=\"ruby-comment cmt\"># Try to log fatal errors to both the Apache server log and a crashfile</span>\n\
      148:         <span class=\"ruby-comment cmt\"># before passing the exception along.</span>\n\
      149:         <span class=\"ruby-identifier\">errmsg</span> = <span class=\"ruby-value str\">&quot;%s failed to start (%s): %s: %s&quot;</span> <span class=\"ruby-operator\">%</span> [\n\
      150:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">name</span>,\n\
      151:             <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>,\n\
      152:             <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>,\n\
      153:             <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">backtrace</span>.<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-value str\">&quot;\\n  &quot;</span>)\n\
      154:         ]\n\
      155: \n\
      156:         <span class=\"ruby-identifier\">logfile</span> = <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">join</span>( <span class=\"ruby-constant\">Dir</span>.<span class=\"ruby-identifier\">tmpdir</span>, <span class=\"ruby-node\">&quot;arrow-fatal.log.#{$$}&quot;</span> )\n\
      157:         <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">open</span>( <span class=\"ruby-identifier\">logfile</span>, <span class=\"ruby-constant\">IO</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">WRONLY</span><span class=\"ruby-operator\">|</span><span class=\"ruby-constant\">IO</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">TRUNC</span><span class=\"ruby-operator\">|</span><span class=\"ruby-constant\">IO</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">CREAT</span> ) {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">ofh</span><span class=\"ruby-operator\">|</span>\n\
      158:             <span class=\"ruby-identifier\">ofh</span>.<span class=\"ruby-identifier\">puts</span>( <span class=\"ruby-identifier\">errmsg</span> )\n\
      159:             <span class=\"ruby-identifier\">ofh</span>.<span class=\"ruby-identifier\">flush</span>\n\
      160:         }\n\
      161: \n\
      162:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">defined?</span>( <span class=\"ruby-constant\">Apache</span> )\n\
      163:             <span class=\"ruby-constant\">Apache</span>.<span class=\"ruby-identifier\">request</span>.<span class=\"ruby-identifier\">server</span>.<span class=\"ruby-identifier\">log_crit</span>( <span class=\"ruby-identifier\">errmsg</span> )\n\
      164:         <span class=\"ruby-keyword kw\">end</span>\n\
      165: \n\
      166:         <span class=\"ruby-constant\">Kernel</span>.<span class=\"ruby-identifier\">raise</span>( <span class=\"ruby-identifier\">err</span> )\n\
      167:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set up one or more <a href="Dispatcher.html#M000438">new</a> <a
      href="Dispatcher.html">Arrow::Dispatcher</a> objects. The
      <tt>configspec</tt> argument can either be the path to a config file, or a
      hash of config files. See the .<a
      href="Dispatcher.html#M000434">instance</a> method for more about how to
      use this method.
      </p>
    params: ( configspec )
  - visibility: public
    aref: M000437
    name: create_configured_dispatchers
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 198</span>\n\
      198:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">create_configured_dispatchers</span>( <span class=\"ruby-identifier\">configspec</span> )\n\
      199:         <span class=\"ruby-identifier\">instances</span> = {}\n\
      200: \n\
      201:         <span class=\"ruby-comment cmt\"># Load a dispatcher for each config</span>\n\
      202:         <span class=\"ruby-identifier\">configspec</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">key</span>, <span class=\"ruby-identifier\">configfile</span><span class=\"ruby-operator\">|</span>\n\
      203: \n\
      204:             <span class=\"ruby-comment cmt\"># Normalize the path to the config file and make sure it's not</span>\n\
      205:             <span class=\"ruby-comment cmt\"># loaded yet. If it is, link it to the current key and skip to the</span>\n\
      206:             <span class=\"ruby-comment cmt\"># next.</span>\n\
      207:             <span class=\"ruby-identifier\">configfile</span> = <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">expand_path</span>( <span class=\"ruby-identifier\">configfile</span> )\n\
      208:             <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">instances</span>.<span class=\"ruby-identifier\">key?</span>( <span class=\"ruby-identifier\">configfile</span> )\n\
      209:                 <span class=\"ruby-identifier\">instances</span>[ <span class=\"ruby-identifier\">key</span> ] = <span class=\"ruby-identifier\">instances</span>[ <span class=\"ruby-identifier\">configfile</span> ]\n\
      210:                 <span class=\"ruby-keyword kw\">next</span>\n\
      211:             <span class=\"ruby-keyword kw\">end</span>\n\
      212: \n\
      213:             <span class=\"ruby-comment cmt\"># If a config file is given, load it. If it's not, just use the</span>\n\
      214:             <span class=\"ruby-comment cmt\"># default config.</span>\n\
      215:             <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">configfile</span>\n\
      216:                 <span class=\"ruby-identifier\">config</span> = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Config</span>.<span class=\"ruby-identifier\">load</span>( <span class=\"ruby-identifier\">configfile</span> )\n\
      217:             <span class=\"ruby-keyword kw\">else</span>\n\
      218:                 <span class=\"ruby-identifier\">config</span> = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Config</span>.<span class=\"ruby-identifier\">new</span>\n\
      219:             <span class=\"ruby-keyword kw\">end</span>\n\
      220: \n\
      221:             <span class=\"ruby-comment cmt\"># Create a dispatcher and put it in the table by both its key and</span>\n\
      222:             <span class=\"ruby-comment cmt\"># the normalized path to its configfile.</span>\n\
      223:             <span class=\"ruby-identifier\">instances</span>[ <span class=\"ruby-identifier\">key</span> ] = <span class=\"ruby-identifier\">instances</span>[ <span class=\"ruby-identifier\">configfile</span> ] = <span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">key</span>, <span class=\"ruby-identifier\">config</span> )\n\
      224:         <span class=\"ruby-keyword kw\">end</span>\n\
      225: \n\
      226:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">instances</span>\n\
      227:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create dispatchers for the config files given in <tt>configspec</tt> and
      return them in a Hash keyed by both the configname key and the expanded
      path to the configuration file.
      </p>
    params: ( configspec )
  - visibility: public
    aref: M000436
    name: create_from_hosts_file
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 173</span>\n\
      173:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">create_from_hosts_file</span>( <span class=\"ruby-identifier\">hosts_file</span> )\n\
      174:         <span class=\"ruby-identifier\">configs</span> = <span class=\"ruby-keyword kw\">nil</span>\n\
      175: \n\
      176:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">hosts_file</span>.<span class=\"ruby-identifier\">respond_to?</span>( <span class=\"ruby-identifier\">:read</span> )\n\
      177:             <span class=\"ruby-identifier\">configs</span> = <span class=\"ruby-constant\">YAML</span>.<span class=\"ruby-identifier\">load</span>( <span class=\"ruby-identifier\">hosts_file</span>.<span class=\"ruby-identifier\">read</span> ) \n\
      178:         <span class=\"ruby-keyword kw\">else</span>\n\
      179:             <span class=\"ruby-identifier\">hosts_file</span>.<span class=\"ruby-identifier\">untaint</span>\n\
      180:             <span class=\"ruby-identifier\">configs</span> = <span class=\"ruby-constant\">YAML</span>.<span class=\"ruby-identifier\">load_file</span>( <span class=\"ruby-identifier\">hosts_file</span> )\n\
      181:         <span class=\"ruby-keyword kw\">end</span>\n\
      182: \n\
      183:         <span class=\"ruby-comment cmt\"># Convert the keys to Symbols and the values to untainted Strings.</span>\n\
      184:         <span class=\"ruby-identifier\">configs</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">key</span>,<span class=\"ruby-identifier\">config</span><span class=\"ruby-operator\">|</span>\n\
      185:             <span class=\"ruby-identifier\">sym</span> = <span class=\"ruby-identifier\">key</span>.<span class=\"ruby-identifier\">to_s</span>.<span class=\"ruby-identifier\">dup</span>.<span class=\"ruby-identifier\">untaint</span>.<span class=\"ruby-identifier\">to_sym</span>\n\
      186:             <span class=\"ruby-identifier\">configs</span>[ <span class=\"ruby-identifier\">sym</span> ] = <span class=\"ruby-identifier\">configs</span>.<span class=\"ruby-identifier\">delete</span>( <span class=\"ruby-identifier\">key</span> )\n\
      187:             <span class=\"ruby-identifier\">configs</span>[ <span class=\"ruby-identifier\">sym</span> ].<span class=\"ruby-identifier\">untaint</span>\n\
      188:         <span class=\"ruby-keyword kw\">end</span>\n\
      189: \n\
      190:         <span class=\"ruby-ivar\">@@Instance</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">create_configured_dispatchers</span>( <span class=\"ruby-identifier\">configs</span> )\n\
      191:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-ivar\">@@Instance</span>\n\
      192:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create one or more dispatchers from the specified <tt>hosts_file</tt>,
      which is a YAML file that maps arrow configurations onto a symbol that can
      be used to refer to it.
      </p>
    params: ( hosts_file )
  - visibility: public
    aref: M000434
    name: instance
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 103</span>\n\
      103:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">instance</span>( <span class=\"ruby-identifier\">key</span>=<span class=\"ruby-identifier\">:__default__</span> )\n\
      104:         <span class=\"ruby-identifier\">rval</span> = <span class=\"ruby-keyword kw\">nil</span>\n\
      105: \n\
      106:         <span class=\"ruby-comment cmt\"># Fetch the instance which corresponds to the given key</span>\n\
      107:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">key</span>.<span class=\"ruby-identifier\">is_a?</span>( <span class=\"ruby-constant\">Symbol</span> )\n\
      108:             <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Logger</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Returning instance for key %p (one of %p): %p&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      109:                 [<span class=\"ruby-identifier\">key</span>, <span class=\"ruby-ivar\">@@Instance</span>.<span class=\"ruby-identifier\">keys</span>, <span class=\"ruby-ivar\">@@Instance</span>[<span class=\"ruby-identifier\">key</span>]]\n\
      110:             <span class=\"ruby-identifier\">rval</span> = <span class=\"ruby-ivar\">@@Instance</span>[ <span class=\"ruby-identifier\">key</span> ]\n\
      111:         <span class=\"ruby-keyword kw\">else</span>\n\
      112:             <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Logger</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Returning instance for configfile %p&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">key</span>]\n\
      113:             <span class=\"ruby-identifier\">configfile</span> = <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">expand_path</span>( <span class=\"ruby-identifier\">key</span> )\n\
      114:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">create</span>( <span class=\"ruby-identifier\">configfile</span> )\n\
      115:             <span class=\"ruby-identifier\">rval</span> = <span class=\"ruby-ivar\">@@Instance</span>[ <span class=\"ruby-identifier\">configfile</span> ]\n\
      116:         <span class=\"ruby-keyword kw\">end</span>\n\
      117: \n\
      118:         <span class=\"ruby-comment cmt\"># Return either a configured Dispatcher instance or a FallbackHandler if</span>\n\
      119:         <span class=\"ruby-comment cmt\"># no Dispatcher corresponds to the given key.</span>\n\
      120:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">rval</span> <span class=\"ruby-operator\">||</span> <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">FallbackHandler</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">key</span>, <span class=\"ruby-ivar\">@@Instance</span> )\n\
      121:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Get the <a href="Dispatcher.html#M000434">instance</a> of the <a
      href="Dispatcher.html">Dispatcher</a> set up under the given <tt>key</tt>,
      which can either be a Symbol or a String containing the path to a
      configfile. If no key is given, it defaults to :<em>default</em>, which is
      the key assigned when .<a href="Dispatcher.html#M000435">create</a> is
      given just a configfile argument.
      </p>
    params: ( key=:__default__ )
  - visibility: public
    aref: M000438
    name: new
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 236</span>\n\
      236:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">config</span> )\n\
      237:         <span class=\"ruby-ivar\">@name</span> = <span class=\"ruby-identifier\">name</span>\n\
      238:         <span class=\"ruby-ivar\">@config</span> = <span class=\"ruby-identifier\">config</span>\n\
      239:         <span class=\"ruby-ivar\">@broker</span> = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Broker</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">config</span> )\n\
      240: \n\
      241:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">configure</span>( <span class=\"ruby-identifier\">config</span> )\n\
      242:     <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Exception</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      243:         <span class=\"ruby-identifier\">msg</span> = <span class=\"ruby-value str\">&quot;%s while creating dispatcher: %s\\n%s&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      244:             [ <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">backtrace</span>.<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-value str\">&quot;\\n\\t&quot;</span>) ]\n\
      245:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">error</span>( <span class=\"ruby-identifier\">msg</span> )\n\
      246:         <span class=\"ruby-identifier\">msg</span>.<span class=\"ruby-identifier\">gsub!</span>( <span class=\"ruby-regexp re\">/%/</span>, <span class=\"ruby-value str\">'%%'</span> )\n\
      247:         <span class=\"ruby-constant\">Apache</span>.<span class=\"ruby-identifier\">request</span>.<span class=\"ruby-identifier\">server</span>.<span class=\"ruby-identifier\">log_crit</span>( <span class=\"ruby-identifier\">msg</span> ) <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-operator\">!</span><span class=\"ruby-keyword kw\">defined?</span>( <span class=\"ruby-constant\">Apache</span> )\n\
      248:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set up an <a href="Dispatcher.html">Arrow::Dispatcher</a> object based on
      the specified <tt>config</tt> (an <a href="Config.html">Arrow::Config</a>
      object).
      </p>
    params: ( name, config )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000440
    name: child_init
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 275</span>\n\
      275:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">child_init</span>( <span class=\"ruby-identifier\">req</span> ) <span class=\"ruby-comment cmt\"># :nodoc</span>\n\
      276:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">notice</span> <span class=\"ruby-value str\">&quot;Dispatcher configured for %s&quot;</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">server</span>.<span class=\"ruby-identifier\">hostname</span> ]\n\
      277:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">OK</span>\n\
      278:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Child init mod_ruby <a href="Dispatcher.html#M000441">handler</a>
      </p>
    params: ( req )
  - visibility: public
    aref: M000439
    name: configure
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 261</span>\n\
      261:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">configure</span>( <span class=\"ruby-identifier\">config</span> )\n\
      262: \n\
      263:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">notice</span> <span class=\"ruby-value str\">&quot;Configuring a dispatcher for '%s' from '%s': child server %d&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      264:             [ <span class=\"ruby-constant\">Apache</span>.<span class=\"ruby-identifier\">request</span>.<span class=\"ruby-identifier\">server</span>.<span class=\"ruby-identifier\">hostname</span>, <span class=\"ruby-identifier\">config</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-constant\">Process</span>.<span class=\"ruby-identifier\">pid</span> ]\n\
      265: \n\
      266:         <span class=\"ruby-comment cmt\"># Configure any modules that have mixed in Arrow::Configurable</span>\n\
      267:         <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Configurable</span>.<span class=\"ruby-identifier\">configure_modules</span>( <span class=\"ruby-identifier\">config</span>, <span class=\"ruby-keyword kw\">self</span> )\n\
      268: \n\
      269:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      (Re)<a href="Dispatcher.html#M000439">configure</a> the dispatcher based on
      the values in the given <tt>config</tt> (an <a
      href="Config.html">Arrow::Config</a> object).
      </p>
    params: ( config )
  - visibility: public
    aref: M000441
    name: handler
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 283</span>\n\
      283:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">handler</span>( <span class=\"ruby-identifier\">req</span> )\n\
      284:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">info</span> <span class=\"ruby-value str\">&quot;--- Dispatching request %p ---------------&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">req</span>]\n\
      285:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Request headers are: %s&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">untable</span>(<span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">headers_in</span>)]\n\
      286: \n\
      287:         <span class=\"ruby-keyword kw\">if</span> (( <span class=\"ruby-identifier\">reason</span> = <span class=\"ruby-ivar\">@config</span>.<span class=\"ruby-identifier\">changed_reason</span> ))\n\
      288:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">notice</span> <span class=\"ruby-node\">&quot;** Reloading configuration: #{reason} ***&quot;</span>\n\
      289:             <span class=\"ruby-ivar\">@config</span>.<span class=\"ruby-identifier\">reload</span>\n\
      290:             <span class=\"ruby-ivar\">@broker</span> = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Broker</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-ivar\">@config</span> )\n\
      291:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">configure</span>( <span class=\"ruby-ivar\">@config</span> )\n\
      292:         <span class=\"ruby-keyword kw\">end</span>\n\
      293: \n\
      294:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-operator\">!</span> <span class=\"ruby-ivar\">@broker</span>\n\
      295:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">error</span> <span class=\"ruby-value str\">&quot;Fatal: No broker.&quot;</span>\n\
      296:             <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">SERVER_ERROR</span>\n\
      297:         <span class=\"ruby-keyword kw\">end</span>\n\
      298: \n\
      299:         <span class=\"ruby-identifier\">txn</span> = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Transaction</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">req</span>, <span class=\"ruby-ivar\">@config</span>, <span class=\"ruby-ivar\">@broker</span> )\n\
      300: \n\
      301:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Delegating transaction %p&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">txn</span>]\n\
      302:         <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">output</span> = <span class=\"ruby-ivar\">@broker</span>.<span class=\"ruby-identifier\">delegate</span>( <span class=\"ruby-identifier\">txn</span> )\n\
      303:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">info</span> <span class=\"ruby-value str\">&quot;Declining transaction (Applets returned: %p)&quot;</span> <span class=\"ruby-operator\">%</span> <span class=\"ruby-identifier\">output</span>\n\
      304:             <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">DECLINED</span>\n\
      305:         <span class=\"ruby-keyword kw\">end</span>\n\
      306: \n\
      307:         <span class=\"ruby-comment cmt\"># If the transaction succeeded, set up the Apache::Request object, add</span>\n\
      308:         <span class=\"ruby-comment cmt\"># headers, add session state, etc. If it failed, log the failure and let</span>\n\
      309:         <span class=\"ruby-comment cmt\"># the status be returned as-is.</span>\n\
      310:         <span class=\"ruby-identifier\">response_body</span> = <span class=\"ruby-keyword kw\">nil</span>\n\
      311:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Transaction has status %d&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">status</span>]\n\
      312: \n\
      313:         <span class=\"ruby-comment cmt\"># Render the output before anything else, as there might be</span>\n\
      314:         <span class=\"ruby-comment cmt\"># session/header manipulation left to be done somewhere in the</span>\n\
      315:         <span class=\"ruby-comment cmt\"># render. If the response is true, the applets have handled output</span>\n\
      316:         <span class=\"ruby-comment cmt\"># themselves.</span>\n\
      317:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">output</span> <span class=\"ruby-operator\">&amp;&amp;</span> <span class=\"ruby-identifier\">output</span> <span class=\"ruby-operator\">!=</span> <span class=\"ruby-keyword kw\">true</span>\n\
      318:             <span class=\"ruby-identifier\">rendertime</span> = <span class=\"ruby-constant\">Benchmark</span>.<span class=\"ruby-identifier\">measure</span> <span class=\"ruby-keyword kw\">do</span>\n\
      319:                 <span class=\"ruby-identifier\">response_body</span> = <span class=\"ruby-identifier\">output</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      320:             <span class=\"ruby-keyword kw\">end</span>\n\
      321:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Output render time: %s&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      322:                 <span class=\"ruby-identifier\">rendertime</span>.<span class=\"ruby-identifier\">format</span>( <span class=\"ruby-value str\">'%8.4us usr %8.4ys sys %8.4ts wall %8.4r'</span> )\n\
      323:             <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">headers_out</span>[<span class=\"ruby-value str\">'content-length'</span>] = <span class=\"ruby-identifier\">response_body</span>.<span class=\"ruby-identifier\">length</span>.<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-keyword kw\">unless</span>\n\
      324:                 <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">headers_out</span>[<span class=\"ruby-value str\">'content-length'</span>]\n\
      325:         <span class=\"ruby-keyword kw\">end</span>\n\
      326: \n\
      327:         <span class=\"ruby-comment cmt\"># If the transaction has a session, save it</span>\n\
      328:         <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">session</span>.<span class=\"ruby-identifier\">save</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">session?</span>\n\
      329: \n\
      330:         <span class=\"ruby-comment cmt\"># Add cookies to the response headers</span>\n\
      331:         <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">add_cookie_headers</span>\n\
      332: \n\
      333:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;HTTP response status is: %d&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">status</span>]\n\
      334:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;Response headers were: %s&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">untable</span>(<span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">headers_out</span>)]\n\
      335:         <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">send_http_header</span>\n\
      336:         <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">print</span>( <span class=\"ruby-identifier\">response_body</span> ) <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">response_body</span>\n\
      337: \n\
      338:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">info</span> <span class=\"ruby-value str\">&quot;--- Done with request %p (%s)---------------&quot;</span> <span class=\"ruby-operator\">%</span> \n\
      339:             [ <span class=\"ruby-identifier\">req</span>, <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">status_line</span> ]\n\
      340: \n\
      341:         <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">sync</span> = <span class=\"ruby-keyword kw\">true</span>\n\
      342:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">handler_status</span>\n\
      343:     <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Exception</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      344:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">error</span> <span class=\"ruby-value str\">&quot;Dispatcher caught an unhandled %s: %s:\\n\\t%s&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      345:             [ <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">backtrace</span>.<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-value str\">&quot;\\n\\t&quot;</span>) ]\n\
      346:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">SERVER_ERROR</span>\n\
      347: \n\
      348:     <span class=\"ruby-keyword kw\">ensure</span>\n\
      349:         <span class=\"ruby-comment cmt\"># Make sure session locks are released</span>\n\
      350:         <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">session</span>.<span class=\"ruby-identifier\">finish</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">txn</span> <span class=\"ruby-operator\">&amp;&amp;</span> <span class=\"ruby-identifier\">txn</span>.<span class=\"ruby-identifier\">session?</span>\n\
      351:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      The content <a href="Dispatcher.html#M000441">handler</a> method.
      Dispatches requests to registered applets based on the requests PATH_INFO.
      </p>
    params: ( req )
  - visibility: public
    aref: M000442
    name: inspect
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 355</span>\n\
      355:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">inspect</span>\n\
      356:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">&quot;#&lt;%s:0x%x config: %s&gt;&quot;</span> <span class=\"ruby-operator\">%</span> [\n\
      357:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>,\n\
      358:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">object_id</span>,\n\
      359:             <span class=\"ruby-ivar\">@config</span>.<span class=\"ruby-identifier\">name</span>,\n\
      360:         ]\n\
      361:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return a human-readable representation of the receiver as a String.
      </p>
    params: ()
  - visibility: public
    aref: M000443
    name: untable
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/dispatcher.rb, line 364</span>\n\
      364:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">untable</span>( <span class=\"ruby-identifier\">table</span> )\n\
      365:         <span class=\"ruby-identifier\">lines</span> = []\n\
      366:         <span class=\"ruby-identifier\">table</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">k</span>,<span class=\"ruby-identifier\">v</span><span class=\"ruby-operator\">|</span>\n\
      367:             <span class=\"ruby-identifier\">lines</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-value str\">&quot;%s: %s&quot;</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">k</span>, <span class=\"ruby-identifier\">v</span> ]\n\
      368:         <span class=\"ruby-keyword kw\">end</span>\n\
      369:         \n\
      370:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">lines</span>.<span class=\"ruby-identifier\">join</span>( <span class=\"ruby-value str\">&quot;; &quot;</span> )\n\
      371:     <span class=\"ruby-keyword kw\">end</span>"
    params: ( table )
  category: Instance
  type: Public

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    SVN Revision
    
  value: "%q$Rev: 437 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: dispatcher.rb 437 2008-03-28 00:49:20Z deveiant $"

[Validate]

Generated with the Darkfish Rdoc Generator.