A little handler to be returned for keys given to the dispatcher for which real instances haven‘t been created.
Create a new instance for the given key and instances.
# File /Users/ged/source/ruby/Arrow/lib/arrow/fallbackhandler.rb, line 27 27: def initialize( key, instances ) 28: @key = key 29: @instances = instances 30: end
Handle a request with output that explains what the problem is.
# File /Users/ged/source/ruby/Arrow/lib/arrow/fallbackhandler.rb, line 34 34: def handler( req ) 35: req.content_type = "text/plain" 36: req.send_http_header 37: req.print "\nArrow Configuration Error\n\nThis URL is configured to be handled by the dispatcher keyed with '\#{@key.inspect}',\nbut there was no dispatcher associated with that key. The instances I know about\nare:\n\n\#{@instances.collect {|k,d| \"-- \#{k.inspect} --\\n\\n\#{d.inspect}\"}.join(\"\\n\\n\")}\n\n" 38: 39: return Apache::OK 40: end
--- SEC00051
--- ""
--- - methods: - visibility: public aref: M000238 name: new sourcecode: " <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/fallbackhandler.rb, line 27</span>\n\ 27: <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">key</span>, <span class=\"ruby-identifier\">instances</span> )\n\ 28: <span class=\"ruby-ivar\">@key</span> = <span class=\"ruby-identifier\">key</span>\n\ 29: <span class=\"ruby-ivar\">@instances</span> = <span class=\"ruby-identifier\">instances</span>\n\ 30: <span class=\"ruby-keyword kw\">end</span>" m_desc: |- <p> Create a <a href="FallbackHandler.html#M000238">new</a> instance for the given <tt>key</tt> and <tt>instances</tt>. </p> params: ( key, instances ) category: Class type: Public - methods: - visibility: public aref: M000239 name: handler sourcecode: " <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/fallbackhandler.rb, line 34</span>\n\ 34: <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">handler</span>( <span class=\"ruby-identifier\">req</span> )\n\ 35: <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">content_type</span> = <span class=\"ruby-value str\">"text/plain"</span>\n\ 36: <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">send_http_header</span>\n\ 37: <span class=\"ruby-identifier\">req</span>.<span class=\"ruby-identifier\">print</span> <span class=\"ruby-value str\">"\\nArrow Configuration Error\\n\\nThis URL is configured to be handled by the dispatcher keyed with '\\#{@key.inspect}',\\nbut there was no dispatcher associated with that key. The instances I know about\\nare:\\n\\n\\#{@instances.collect {|k,d| \\"-- \\#{k.inspect} --\\\\n\\\\n\\#{d.inspect}\\"}.join(\\"\\\\n\\\\n\\")}\\n\\n"</span>\n\ 38: \n\ 39: <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\ 40: <span class=\"ruby-keyword kw\">end</span>" m_desc: |- <p> Handle a request with output that explains what the problem is. </p> params: ( req ) category: Instance type: Public
---
Generated with the Darkfish Rdoc Generator.