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::Transaction

The transaction class for Arrow web applications.

Constants

SVNRev
SVN Revision
SVNId
SVN Id
HTMLDoc
(Not documented)
StatusName
Status names
DelegatedMethods
(Not documented)
FORM_CONTENT_TYPES
(Not documented)

Attributes

applet_path[RW]
The applet portion of the path_info
broker[R]
The Arrow::Broker that is responsible for delegating the Transaction to one or more Arrow::Applet objects.
config[R]
The Arrow::Config object for the Arrow application that created this transaction.
cookies[R]
The Arrow::CookieSet that contains cookies to be added to the response
data[R]
User-data hash. Can be used to pass data between applets in a chain.
handler_status[RW]
The handler status code to return to Apache
request[R]
The Apache::Request that initiated this transaction
request_cookies[R]
The Hash of Arrow::Cookies parsed from the request
serial[R]
The transaction‘s unique id in the context of the system.
vargs[RW]
The argument validator (a FormValidator object)

Public Class Methods

new( request, config, broker ) click to toggle source

Create a new Arrow::Transaction object with the specified request (an Apache::Request object), config (an Arrow::Config object), broker object (an Arrow::Broker), and session (Arrow::Session) objects.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 86
 86:     def initialize( request, config, broker )
 87:         @request          = request
 88:         @config               = config
 89:         @broker               = broker
 90:         @handler_status     = Apache::OK
 91: 
 92:         @serial               = make_transaction_serial( request )
 93: 
 94:         # Stuff that may be filled in later
 95:         @session          = nil # Lazily-instantiated
 96:         @applet_path      = nil # Added by the broker
 97:         @vargs                = nil # Filled in by the applet
 98:         @data             = {}
 99:         @request_cookies  = parse_cookies( request )
100:         @cookies          = Arrow::CookieSet.new()
101: 
102:         # Check for a "RubyOption root_dispatcher true"
103:         if @request.options.key?('root_dispatcher') &&
104:             @request.options['root_dispatcher'].match( /^(true|yes|1)$/i )
105:             self.log.debug "Dispatching from root path"
106:             @root_dispatcher = true
107:         else
108:             self.log.debug "Dispatching from sub-path"
109:             @root_dispatcher = false
110:         end
111: 
112:         super()
113:     end

Public Instance Methods

add_cookie_headers() click to toggle source

Add a ‘Set-Cookie’ header to the response for each cookie that currently exists the transaction‘s cookieset.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 319
319:     def add_cookie_headers
320:         self.cookies.each do |cookie|
321:             if self.is_success?
322:                 self.log.debug "Adding 'Set-Cookie' header: %p (%p)" % 
323:                     [cookie, cookie.to_s]
324:                 self.headers_out['Set-Cookie'] = cookie.to_s
325:             else
326:                 self.log.debug "Adding 'Set-Cookie' to the error headers: %p (%p)" %
327:                     [cookie, cookie.to_s]
328:                 self.err_headers_out['Set-Cookie'] = cookie.to_s
329:             end
330:         end
331:     end
app_root() click to toggle source

Return the portion of the request‘s URI that serves as the base URI for the application. All self-referential URLs created by the application should include this.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 242
242:     def app_root
243:         return "" if self.root_dispatcher?
244:         return @request.script_name
245:     end
Also aliased as: approot
app_root_url() click to toggle source

Returns a fully-qualified URI String to the current applet using the request object‘s server name and port.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 251
251:     def app_root_url
252:         return construct_url( self.app_root )
253:     end
Also aliased as: approot_url
applet() click to toggle source

Return an absolute uri that refers back to the applet the transaction is being run in

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 259
259:     def applet
260:         return [ self.app_root, self.applet_path ].join("/").gsub( %r{//+}, '/' )
261:     end
Also aliased as: applet_uri
applet_uri() click to toggle source

Alias for #applet

applet_url() click to toggle source

Returns a fully-qualified URI String to the current applet using the request object‘s server name and port.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 268
268:     def applet_url
269:         return construct_url( self.applet )
270:     end
approot() click to toggle source

Alias for #app_root

approot_url() click to toggle source

Alias for #app_root_url

arrow_version() click to toggle source

Get the verson of Arrow currently running.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 506
506:     def arrow_version
507:         return Arrow::VERSION
508:     end
attachment=( filename ) click to toggle source

Set the result‘s ‘Content-Disposition’ header to ‘attachment’ and set the attachment‘s filename.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 378
378:     def attachment=( filename )
379:         
380:         # IE flubs attachments of any mimetype it handles directly.
381:         if self.browser_is_ie?
382:             self.content_type = 'application/octet-stream'
383:         end
384:         
385:         val = %q{attachment; filename="%s"} % [ filename ]
386:         self.headers_out['Content-Disposition'] = val
387:     end
browser_is_ie?() click to toggle source

Returns true if the User-Agent header indicates that the remote browser is Internet Explorer. Useful for making the inevitable IE workarounds.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 406
406:     def browser_is_ie?
407:         agent = self.headers_in['user-agent'] || ''
408:         return agent =~ /MSIE/ ? true : false
409:     end
construct_url( uri ) click to toggle source

Overridden from Apache::Request to take Apache mod_proxy headers into account. If the ‘X-Forwarded-Host’ or ‘X-Forwarded-Server’ headers exist in the request, the hostname specified is used instead of the canonical host.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 338
338:     def construct_url( uri )
339:         url = @request.construct_url( uri )
340: 
341:         # If the request came through a proxy, rewrite the url's host to match
342:         # the hostname the proxy is forwarding for.
343:         if (( host = self.proxied_host ))
344:             uriobj = URI.parse( url )
345:             uriobj.host = host
346:             url = uriobj.to_s
347:         end
348:         
349:         return url
350:     end
for_ie_users() {|if self.browser_is_ie?| ...} click to toggle source

Execute a block if the User-Agent header indicates that the remote browser is Internet Explorer. Useful for making the inevitable IE workarounds.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 415
415:     def for_ie_users
416:         yield if self.browser_is_ie?
417:     end
form_request?() click to toggle source

Return true if there are HTML form parameters in the request, either in the query string with a GET request, or in the body of a POST with a mimetype of either ‘application/x-www-form-urlencoded’ or ‘multipart/form-data’.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 434
434:     def form_request?
435:         case self.request_method
436:         when 'GET', 'HEAD', 'DELETE', 'PUT'
437:             return (!self.parsed_uri.query.nil? || 
438:                 self.request_content_type =~ FORM_CONTENT_TYPES) ? true : false
439:             
440:         when 'POST'
441:             return self.request_content_type =~ FORM_CONTENT_TYPES ? true : false
442:             
443:         else
444:             return false
445:         end
446:     end
inspect() click to toggle source

Returns a human-readable String representation of the transaction, suitable for debugging.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 159
159:     def inspect
160:         "#<%s:0x%0x serial: %s; HTTP status: %d>" % [
161:             self.class.name,
162:             self.object_id * 2,
163:             self.serial,
164:             self.status
165:         ]
166:     end
is_ajax_request?() click to toggle source

Return true if the request is from XMLHttpRequest (as indicated by the ‘X-Requested-With’ header from Scriptaculous or jQuery)

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 422
422:     def is_ajax_request?
423:         xrw_header = self.headers_in['x-requested-with']
424:         return true if !xrw_header.nil? && xrw_header =~ /xmlhttprequest/i
425:         return false
426:     end
is_declined?() click to toggle source

Returns true if the transaction‘s server status will cause the request to be declined (i.e., not handled by Arrow)

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 190
190:     def is_declined?
191:         self.log.debug "Checking to see if the transaction is declined (%p)" %
192:           [self.handler_status]
193:         return self.handler_status == Apache::DECLINED ? true : false
194:     end
is_success?() click to toggle source

Returns true if the transactions response status is 2xx.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 182
182:     def is_success?
183:         return nil unless self.status
184:         return (self.status / 100) == 2
185:     end
not_modified() click to toggle source

Set the necessary header fields in the response to cause a NOT_MODIFIED response to be sent.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 487
487:     def not_modified
488:         return self.redirect( uri, Apache::HTTP_NOT_MODIFIED )
489:     end
parsed_uri() click to toggle source

Return a URI object that is parsed from the request‘s URI.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 391
391:     def parsed_uri
392:         return URI.parse( self.request.unparsed_uri )
393:     end
path() click to toggle source

Returns the path operated on by the Arrow::Broker when delegating the transaction. Equal to the #uri minus the #app_root.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 232
232:     def path
233:         path = @request.uri
234:         uripat = Regexp.new( "^" + self.app_root )
235:         return path.sub( uripat, '' )
236:     end
proxied_host() click to toggle source

If the request came from a reverse proxy (i.e., the X-Forwarded-Host or X-Forwarded-Server headers are present), return the hostname that the proxy is forwarding for. If no proxy headers are present, return nil.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 357
357:     def proxied_host
358:         headers = @request.headers_in
359:         return headers['x-forwarded-host'] || headers['x-forwarded-server']
360:     end
redirect( uri, status_code=Apache::HTTP_MOVED_TEMPORARILY ) click to toggle source

Set the necessary fields in the request to cause the response to be a redirect to the given url with the specified status_code (302 by default).

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 475
475:     def redirect( uri, status_code=Apache::HTTP_MOVED_TEMPORARILY )
476:         self.log.debug "Redirecting to %s" % uri
477:         self.headers_out[ 'Location' ] = uri.to_s
478:         self.status = status_code
479:         self.handler_status = Apache::REDIRECT
480: 
481:         return ''
482:     end
referer() click to toggle source

Get the request‘s referer, if any

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 371
371:     def referer
372:         return self.headers_in['Referer']
373:     end
referring_action() click to toggle source

If the referer was another applet under the same Arrow instance, return the name of the action that preceded the current one. If there was no ‘Referer’ header, or the referer wasn‘t an applet under the same Arrow instance, return nil.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 296
296:     def referring_action
297:         return nil unless self.referer
298:         uri = URI.parse( self.referer )
299:         path = uri.path or return nil
300:         appletRe = Regexp.new( self.app_root + "/\\w+/" )
301: 
302:         return nil unless appletRe.match( path )
303:         subpath = path.
304:             sub( appletRe, '' ).
305:             split( %r{/} ).
306:             first
307: 
308:         return subpath
309:     end
referring_applet() click to toggle source

If the referer was another applet under the same Arrow instance, return the uri to it. If there was no ‘Referer’ header, or the referer wasn‘t an applet under the same Arrow instance, returns nil.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 276
276:     def referring_applet
277:         return nil unless self.referer
278:         uri = URI.parse( self.referer )
279:         path = uri.path or return nil
280:         rootRe = Regexp.new( self.app_root + "/" )
281: 
282:         return nil unless rootRe.match( path )
283:         subpath = path.
284:             sub( rootRe, '' ).
285:             split( %r{/} ).
286:             first
287: 
288:         return subpath
289:     end
refresh( seconds, url=nil ) click to toggle source

Set the necessary header to make the displayed page refresh to the specified url in the given number of seconds.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 494
494:     def refresh( seconds, url=nil )
495:         seconds = Integer( seconds )
496:         url ||= self.construct_url( '' )
497:         if !URI.parse( url ).absolute?
498:             url = self.construct_url( url )
499:         end
500:         
501:         self.headers_out['Refresh'] = "%d;%s" % [seconds, url]
502:     end
remote_ip() click to toggle source

Fetch the client‘s IP, either from proxy headers or the connection‘s IP.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 364
364:     def remote_ip
365:         return self.headers_in['X-Forwarded-For'] || self.connection.remote_ip
366:     end
request_content_type() click to toggle source

Return the Content-type header given in the request‘s headers, if any

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 397
397:     def request_content_type
398:         return self.headers_in['Content-type']
399:     end
root_dispatcher?() click to toggle source

Returns true if the dispatcher is mounted on the root URI ("/")

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 225
225:     def root_dispatcher?
226:         return @root_dispatcher
227:     end
session( config={} ) click to toggle source

The session associated with the receiver (an Arrow::Session object).

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 176
176:     def session( config={} )
177:         @session ||= Arrow::Session.create( self, config )
178:     end
session?() click to toggle source

Returns true if a session has been created for the receiver.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 170
170:     def session?
171:         @session ? true : false
172:     end
status_doc( status_code, uri=nil ) click to toggle source

Return a minimal HTML doc for representing a given status_code

     # File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 454
454:     def status_doc( status_code, uri=nil )
455:         body = ''
456:         if uri
457:             body = %q{<a href="%s">%s</a>} % [ uri, uri ]
458:         end
459: 
460:         #<head><title>%d %s</title></head>
461:         #<body><h1>%s</h1><p>%s</p></body>
462:         return HTMLDoc % [
463:             status_code,
464:             StatusName[status_code],
465:             StatusName[status_code],
466:             body
467:         ]
468:     end

secsequence

--- SEC00184

seccomment

--- ""

attributes

--- 
- name: applet_path
  rw: RW
  a_desc: |+
    
    The <a href="Transaction.html#M000213">applet</a> portion of the path_info
    
- name: broker
  rw: R
  a_desc: |+
    
    The <a href="Broker.html">Arrow::Broker</a> that is responsible for
    delegating the <a href="Transaction.html">Transaction</a> to one or more <a
    href="Applet.html">Arrow::Applet</a> objects.
    
- name: config
  rw: R
  a_desc: |+
    
    The <a href="Config.html">Arrow::Config</a> object for the <a
    href="../Arrow.html">Arrow</a> application that created this transaction.
    
- name: cookies
  rw: R
  a_desc: |+
    
    The <a href="CookieSet.html">Arrow::CookieSet</a> that contains cookies to
    be added to the response
    
- name: data
  rw: R
  a_desc: |+
    
    User-data hash. Can be used to pass data between applets in a chain.
    
- name: handler_status
  rw: RW
  a_desc: |+
    
    The handler status code to return to Apache
    
- name: request
  rw: R
  a_desc: |+
    
    The <a href="../Apache/Request.html">Apache::Request</a> that initiated
    this transaction
    
- name: request_cookies
  rw: R
  a_desc: |+
    
    The Hash of Arrow::Cookies parsed from the request
    
- name: serial
  rw: R
  a_desc: |+
    
    The transaction&#8216;s unique id in the context of the system.
    
- name: vargs
  rw: RW
  a_desc: |+
    
    The argument validator (a <a href="FormValidator.html">FormValidator</a>
    object)
    

method_list

--- 
- methods: 
  - visibility: public
    aref: M000201
    name: new
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 86</span>\n 86:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">request</span>, <span class=\"ruby-identifier\">config</span>, <span class=\"ruby-identifier\">broker</span> )\n 87:         <span class=\"ruby-ivar\">@request</span>          = <span class=\"ruby-identifier\">request</span>\n 88:         <span class=\"ruby-ivar\">@config</span>               = <span class=\"ruby-identifier\">config</span>\n 89:         <span class=\"ruby-ivar\">@broker</span>               = <span class=\"ruby-identifier\">broker</span>\n 90:         <span class=\"ruby-ivar\">@handler_status</span>     = <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">OK</span>\n 91: \n 92:         <span class=\"ruby-ivar\">@serial</span>               = <span class=\"ruby-identifier\">make_transaction_serial</span>( <span class=\"ruby-identifier\">request</span> )\n 93: \n 94:         <span class=\"ruby-comment cmt\"># Stuff that may be filled in later</span>\n 95:         <span class=\"ruby-ivar\">@session</span>          = <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-comment cmt\"># Lazily-instantiated</span>\n 96:         <span class=\"ruby-ivar\">@applet_path</span>      = <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-comment cmt\"># Added by the broker</span>\n 97:         <span class=\"ruby-ivar\">@vargs</span>                = <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-comment cmt\"># Filled in by the applet</span>\n 98:         <span class=\"ruby-ivar\">@data</span>             = {}\n 99:         <span class=\"ruby-ivar\">@request_cookies</span>  = <span class=\"ruby-identifier\">parse_cookies</span>( <span class=\"ruby-identifier\">request</span> )\n\
      100:         <span class=\"ruby-ivar\">@cookies</span>          = <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">CookieSet</span>.<span class=\"ruby-identifier\">new</span>()\n\
      101: \n\
      102:         <span class=\"ruby-comment cmt\"># Check for a &quot;RubyOption root_dispatcher true&quot;</span>\n\
      103:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">key?</span>(<span class=\"ruby-value str\">'root_dispatcher'</span>) <span class=\"ruby-operator\">&amp;&amp;</span>\n\
      104:             <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">options</span>[<span class=\"ruby-value str\">'root_dispatcher'</span>].<span class=\"ruby-identifier\">match</span>( <span class=\"ruby-regexp re\">/^(true|yes|1)$/i</span> )\n\
      105:             <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;Dispatching from root path&quot;</span>\n\
      106:             <span class=\"ruby-ivar\">@root_dispatcher</span> = <span class=\"ruby-keyword kw\">true</span>\n\
      107:         <span class=\"ruby-keyword kw\">else</span>\n\
      108:             <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;Dispatching from sub-path&quot;</span>\n\
      109:             <span class=\"ruby-ivar\">@root_dispatcher</span> = <span class=\"ruby-keyword kw\">false</span>\n\
      110:         <span class=\"ruby-keyword kw\">end</span>\n\
      111: \n\
      112:         <span class=\"ruby-keyword kw\">super</span>()\n\
      113:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create a <a href="Transaction.html#M000201">new</a> <a
      href="Transaction.html">Arrow::Transaction</a> object with the specified
      <tt>request</tt> (an <a href="../Apache/Request.html">Apache::Request</a>
      object), <tt>config</tt> (an <a href="Config.html">Arrow::Config</a>
      object), <tt>broker</tt> object (an <a
      href="Broker.html">Arrow::Broker</a>), and <tt><a
      href="Transaction.html#M000204">session</a></tt> (<a
      href="Session.html">Arrow::Session</a>) objects.
      </p>
    params: ( request, config, broker )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000218
    name: add_cookie_headers
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 319</span>\n\
      319:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">add_cookie_headers</span>\n\
      320:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">cookies</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">cookie</span><span class=\"ruby-operator\">|</span>\n\
      321:             <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">is_success?</span>\n\
      322:                 <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;Adding 'Set-Cookie' header: %p (%p)&quot;</span> <span class=\"ruby-operator\">%</span> \n\
      323:                     [<span class=\"ruby-identifier\">cookie</span>, <span class=\"ruby-identifier\">cookie</span>.<span class=\"ruby-identifier\">to_s</span>]\n\
      324:                 <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_out</span>[<span class=\"ruby-value str\">'Set-Cookie'</span>] = <span class=\"ruby-identifier\">cookie</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      325:             <span class=\"ruby-keyword kw\">else</span>\n\
      326:                 <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;Adding 'Set-Cookie' to the error headers: %p (%p)&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      327:                     [<span class=\"ruby-identifier\">cookie</span>, <span class=\"ruby-identifier\">cookie</span>.<span class=\"ruby-identifier\">to_s</span>]\n\
      328:                 <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">err_headers_out</span>[<span class=\"ruby-value str\">'Set-Cookie'</span>] = <span class=\"ruby-identifier\">cookie</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      329:             <span class=\"ruby-keyword kw\">end</span>\n\
      330:         <span class=\"ruby-keyword kw\">end</span>\n\
      331:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Add a &#8216;Set-<a href="Cookie.html">Cookie</a>&#8217; header to the
      response for each cookie that currently exists the transaction&#8216;s
      cookieset.
      </p>
    params: ()
  - visibility: public
    aref: M000209
    name: app_root
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 242</span>\n\
      242:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">app_root</span>\n\
      243:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">&quot;&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">root_dispatcher?</span>\n\
      244:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">script_name</span>\n\
      245:     <span class=\"ruby-keyword kw\">end</span>"
    aka: 
    - aref: Transaction.html#M000210
      name: approot
    m_desc: |-
      <p>
      Return the portion of the request&#8216;s URI that serves as the base URI
      for the application. All self-referential URLs created by the application
      should include this.
      </p>
    params: ()
  - visibility: public
    aref: M000211
    name: app_root_url
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 251</span>\n\
      251:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">app_root_url</span>\n\
      252:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">app_root</span> )\n\
      253:     <span class=\"ruby-keyword kw\">end</span>"
    aka: 
    - aref: Transaction.html#M000212
      name: approot_url
    m_desc: |-
      <p>
      Returns a fully-qualified URI String to the current <a
      href="Transaction.html#M000213">applet</a> using the request object&#8216;s
      server name and port.
      </p>
    params: ()
  - visibility: public
    aref: M000213
    name: applet
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 259</span>\n\
      259:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">applet</span>\n\
      260:         <span class=\"ruby-keyword kw\">return</span> [ <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">app_root</span>, <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">applet_path</span> ].<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-value str\">&quot;/&quot;</span>).<span class=\"ruby-identifier\">gsub</span>( <span class=\"ruby-regexp re\">%r{//+}</span>, <span class=\"ruby-value str\">'/'</span> )\n\
      261:     <span class=\"ruby-keyword kw\">end</span>"
    aka: 
    - aref: Transaction.html#M000214
      name: applet_uri
    m_desc: |-
      <p>
      Return an absolute uri that refers back to the <a
      href="Transaction.html#M000213">applet</a> the transaction is being run in
      </p>
    params: ()
  - visibility: public
    aref: M000214
    name: applet_uri
    m_desc: |-
      <p>
      Alias for <a href="Transaction.html#M000213">#applet</a>
      </p>
    params: ()
  - visibility: public
    aref: M000215
    name: applet_url
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 268</span>\n\
      268:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">applet_url</span>\n\
      269:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">applet</span> )\n\
      270:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns a fully-qualified URI String to the current <a
      href="Transaction.html#M000213">applet</a> using the request object&#8216;s
      server name and port.
      </p>
    params: ()
  - visibility: public
    aref: M000210
    name: approot
    m_desc: |-
      <p>
      Alias for <a href="Transaction.html#M000209">#app_root</a>
      </p>
    params: ()
  - visibility: public
    aref: M000212
    name: approot_url
    m_desc: |-
      <p>
      Alias for <a href="Transaction.html#M000211">#app_root_url</a>
      </p>
    params: ()
  - visibility: public
    aref: M000234
    name: arrow_version
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 506</span>\n\
      506:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">arrow_version</span>\n\
      507:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">VERSION</span>\n\
      508:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Get the verson of <a href="../Arrow.html">Arrow</a> currently running.
      </p>
    params: ()
  - visibility: public
    aref: M000223
    name: attachment=
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 378</span>\n\
      378:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">attachment=</span>( <span class=\"ruby-identifier\">filename</span> )\n\
      379:         \n\
      380:         <span class=\"ruby-comment cmt\"># IE flubs attachments of any mimetype it handles directly.</span>\n\
      381:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">browser_is_ie?</span>\n\
      382:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">content_type</span> = <span class=\"ruby-value str\">'application/octet-stream'</span>\n\
      383:         <span class=\"ruby-keyword kw\">end</span>\n\
      384:         \n\
      385:         <span class=\"ruby-identifier\">val</span> = <span class=\"ruby-value str\">%q{attachment; filename=&quot;%s&quot;}</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">filename</span> ]\n\
      386:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_out</span>[<span class=\"ruby-value str\">'Content-Disposition'</span>] = <span class=\"ruby-identifier\">val</span>\n\
      387:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set the result&#8216;s &#8216;Content-Disposition&#8217; header to
      &#8216;attachment&#8217; and set the attachment&#8216;s <tt>filename</tt>.
      </p>
    params: ( filename )
  - visibility: public
    aref: M000226
    name: browser_is_ie?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 406</span>\n\
      406:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">browser_is_ie?</span>\n\
      407:         <span class=\"ruby-identifier\">agent</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_in</span>[<span class=\"ruby-value str\">'user-agent'</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-value str\">''</span>\n\
      408:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">agent</span> <span class=\"ruby-operator\">=~</span> <span class=\"ruby-regexp re\">/MSIE/</span> <span class=\"ruby-operator\">?</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      409:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns true if the User-Agent header indicates that the remote browser is
      Internet Explorer. Useful for making the inevitable IE workarounds.
      </p>
    params: ()
  - visibility: public
    aref: M000219
    name: construct_url
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 338</span>\n\
      338:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-identifier\">uri</span> )\n\
      339:         <span class=\"ruby-identifier\">url</span> = <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-identifier\">uri</span> )\n\
      340: \n\
      341:         <span class=\"ruby-comment cmt\"># If the request came through a proxy, rewrite the url's host to match</span>\n\
      342:         <span class=\"ruby-comment cmt\"># the hostname the proxy is forwarding for.</span>\n\
      343:         <span class=\"ruby-keyword kw\">if</span> (( <span class=\"ruby-identifier\">host</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">proxied_host</span> ))\n\
      344:             <span class=\"ruby-identifier\">uriobj</span> = <span class=\"ruby-constant\">URI</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-identifier\">url</span> )\n\
      345:             <span class=\"ruby-identifier\">uriobj</span>.<span class=\"ruby-identifier\">host</span> = <span class=\"ruby-identifier\">host</span>\n\
      346:             <span class=\"ruby-identifier\">url</span> = <span class=\"ruby-identifier\">uriobj</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      347:         <span class=\"ruby-keyword kw\">end</span>\n\
      348:         \n\
      349:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">url</span>\n\
      350:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Overridden from <a href="../Apache/Request.html">Apache::Request</a> to
      take Apache mod_proxy headers into account. If the
      &#8216;X-Forwarded-Host&#8217; or &#8216;X-Forwarded-Server&#8217; headers
      exist in the request, the hostname specified is used instead of the
      canonical host.
      </p>
    params: ( uri )
  - visibility: public
    aref: M000227
    name: for_ie_users
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 415</span>\n\
      415:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">for_ie_users</span>\n\
      416:         <span class=\"ruby-keyword kw\">yield</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">browser_is_ie?</span>\n\
      417:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Execute a block if the User-Agent header indicates that the remote browser
      is Internet Explorer. Useful for making the inevitable IE workarounds.
      </p>
    params: () {|if self.browser_is_ie?| ...}
  - visibility: public
    aref: M000229
    name: form_request?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 434</span>\n\
      434:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">form_request?</span>\n\
      435:         <span class=\"ruby-keyword kw\">case</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">request_method</span>\n\
      436:         <span class=\"ruby-keyword kw\">when</span> <span class=\"ruby-value str\">'GET'</span>, <span class=\"ruby-value str\">'HEAD'</span>, <span class=\"ruby-value str\">'DELETE'</span>, <span class=\"ruby-value str\">'PUT'</span>\n\
      437:             <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-operator\">!</span><span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">parsed_uri</span>.<span class=\"ruby-identifier\">query</span>.<span class=\"ruby-identifier\">nil?</span> <span class=\"ruby-operator\">||</span> \n\
      438:                 <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">request_content_type</span> <span class=\"ruby-operator\">=~</span> <span class=\"ruby-constant\">FORM_CONTENT_TYPES</span>) <span class=\"ruby-operator\">?</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      439:             \n\
      440:         <span class=\"ruby-keyword kw\">when</span> <span class=\"ruby-value str\">'POST'</span>\n\
      441:             <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">request_content_type</span> <span class=\"ruby-operator\">=~</span> <span class=\"ruby-constant\">FORM_CONTENT_TYPES</span> <span class=\"ruby-value\">? </span><span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      442:             \n\
      443:         <span class=\"ruby-keyword kw\">else</span>\n\
      444:             <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">false</span>\n\
      445:         <span class=\"ruby-keyword kw\">end</span>\n\
      446:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return <tt>true</tt> if there are HTML form parameters in the request,
      either in the query string with a GET request, or in the body of a POST
      with a mimetype of either &#8216;application/x-www-form-urlencoded&#8217;
      or &#8216;multipart/form-data&#8217;.
      </p>
    params: ()
  - visibility: public
    aref: M000202
    name: inspect
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 159</span>\n\
      159:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">inspect</span>\n\
      160:         <span class=\"ruby-value str\">&quot;#&lt;%s:0x%0x serial: %s; HTTP status: %d&gt;&quot;</span> <span class=\"ruby-operator\">%</span> [\n\
      161:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>,\n\
      162:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">object_id</span> <span class=\"ruby-operator\">*</span> <span class=\"ruby-value\">2</span>,\n\
      163:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">serial</span>,\n\
      164:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">status</span>\n\
      165:         ]\n\
      166:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns a human-readable String representation of the transaction, suitable
      for debugging.
      </p>
    params: ()
  - visibility: public
    aref: M000228
    name: is_ajax_request?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 422</span>\n\
      422:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">is_ajax_request?</span>\n\
      423:         <span class=\"ruby-identifier\">xrw_header</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_in</span>[<span class=\"ruby-value str\">'x-requested-with'</span>]\n\
      424:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-operator\">!</span><span class=\"ruby-identifier\">xrw_header</span>.<span class=\"ruby-identifier\">nil?</span> <span class=\"ruby-operator\">&amp;&amp;</span> <span class=\"ruby-identifier\">xrw_header</span> <span class=\"ruby-operator\">=~</span> <span class=\"ruby-regexp re\">/xmlhttprequest/i</span>\n\
      425:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">false</span>\n\
      426:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return <tt>true</tt> if the request is from XMLHttpRequest (as indicated by
      the &#8216;X-Requested-With&#8217; header from Scriptaculous or jQuery)
      </p>
    params: ()
  - visibility: public
    aref: M000206
    name: is_declined?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 190</span>\n\
      190:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">is_declined?</span>\n\
      191:         <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;Checking to see if the transaction is declined (%p)&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      192:           [<span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">handler_status</span>]\n\
      193:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">handler_status</span> <span class=\"ruby-operator\">==</span> <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">DECLINED</span> <span class=\"ruby-value\">? </span><span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      194:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns true if the transaction&#8216;s server status will cause the
      request to be declined (i.e., not handled by <a
      href="../Arrow.html">Arrow</a>)
      </p>
    params: ()
  - visibility: public
    aref: M000205
    name: is_success?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 182</span>\n\
      182:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">is_success?</span>\n\
      183:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">status</span>\n\
      184:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">status</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">100</span>) <span class=\"ruby-operator\">==</span> <span class=\"ruby-value\">2</span>\n\
      185:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns true if the transactions response status is 2xx.
      </p>
    params: ()
  - visibility: public
    aref: M000232
    name: not_modified
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 487</span>\n\
      487:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">not_modified</span>\n\
      488:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">redirect</span>( <span class=\"ruby-identifier\">uri</span>, <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">HTTP_NOT_MODIFIED</span> )\n\
      489:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set the necessary header fields in the response to cause a NOT_MODIFIED
      response to be sent.
      </p>
    params: ()
  - visibility: public
    aref: M000224
    name: parsed_uri
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 391</span>\n\
      391:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">parsed_uri</span>\n\
      392:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">URI</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">request</span>.<span class=\"ruby-identifier\">unparsed_uri</span> )\n\
      393:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return a URI object that is parsed from the request&#8216;s URI.
      </p>
    params: ()
  - visibility: public
    aref: M000208
    name: path
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 232</span>\n\
      232:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">path</span>\n\
      233:         <span class=\"ruby-identifier\">path</span> = <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">uri</span>\n\
      234:         <span class=\"ruby-identifier\">uripat</span> = <span class=\"ruby-constant\">Regexp</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-value str\">&quot;^&quot;</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">app_root</span> )\n\
      235:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">path</span>.<span class=\"ruby-identifier\">sub</span>( <span class=\"ruby-identifier\">uripat</span>, <span class=\"ruby-value str\">''</span> )\n\
      236:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns the <a href="Transaction.html#M000208">path</a> operated on by the
      <a href="Broker.html">Arrow::Broker</a> when delegating the transaction.
      Equal to the #uri minus the <a
      href="Transaction.html#M000209">#app_root</a>.
      </p>
    params: ()
  - visibility: public
    aref: M000220
    name: proxied_host
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 357</span>\n\
      357:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">proxied_host</span>\n\
      358:         <span class=\"ruby-identifier\">headers</span> = <span class=\"ruby-ivar\">@request</span>.<span class=\"ruby-identifier\">headers_in</span>\n\
      359:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">headers</span>[<span class=\"ruby-value str\">'x-forwarded-host'</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-identifier\">headers</span>[<span class=\"ruby-value str\">'x-forwarded-server'</span>]\n\
      360:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      If the request came from a reverse proxy (i.e., the X-Forwarded-Host or
      X-Forwarded-Server headers are present), return the hostname that the proxy
      is forwarding for. If no proxy headers are present, return nil.
      </p>
    params: ()
  - visibility: public
    aref: M000231
    name: redirect
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 475</span>\n\
      475:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">redirect</span>( <span class=\"ruby-identifier\">uri</span>, <span class=\"ruby-identifier\">status_code</span>=<span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">HTTP_MOVED_TEMPORARILY</span> )\n\
      476:         <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;Redirecting to %s&quot;</span> <span class=\"ruby-operator\">%</span> <span class=\"ruby-identifier\">uri</span>\n\
      477:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_out</span>[ <span class=\"ruby-value str\">'Location'</span> ] = <span class=\"ruby-identifier\">uri</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      478:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">status</span> = <span class=\"ruby-identifier\">status_code</span>\n\
      479:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">handler_status</span> = <span class=\"ruby-constant\">Apache</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">REDIRECT</span>\n\
      480: \n\
      481:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">''</span>\n\
      482:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set the necessary fields in the request to cause the response to be a <a
      href="Transaction.html#M000231">redirect</a> to the given <tt>url</tt> with
      the specified <tt>status_code</tt> (302 by default).
      </p>
    params: ( uri, status_code=Apache::HTTP_MOVED_TEMPORARILY )
  - visibility: public
    aref: M000222
    name: referer
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 371</span>\n\
      371:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">referer</span>\n\
      372:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_in</span>[<span class=\"ruby-value str\">'Referer'</span>]\n\
      373:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Get the request&#8216;s <a href="Transaction.html#M000222">referer</a>, if
      any
      </p>
    params: ()
  - visibility: public
    aref: M000217
    name: referring_action
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 296</span>\n\
      296:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">referring_action</span>\n\
      297:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">referer</span>\n\
      298:         <span class=\"ruby-identifier\">uri</span> = <span class=\"ruby-constant\">URI</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">referer</span> )\n\
      299:         <span class=\"ruby-identifier\">path</span> = <span class=\"ruby-identifier\">uri</span>.<span class=\"ruby-identifier\">path</span> <span class=\"ruby-keyword kw\">or</span> <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span>\n\
      300:         <span class=\"ruby-identifier\">appletRe</span> = <span class=\"ruby-constant\">Regexp</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">app_root</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">&quot;/\\\\w+/&quot;</span> )\n\
      301: \n\
      302:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">appletRe</span>.<span class=\"ruby-identifier\">match</span>( <span class=\"ruby-identifier\">path</span> )\n\
      303:         <span class=\"ruby-identifier\">subpath</span> = <span class=\"ruby-identifier\">path</span>.\n\
      304:             <span class=\"ruby-identifier\">sub</span>( <span class=\"ruby-identifier\">appletRe</span>, <span class=\"ruby-value str\">''</span> ).\n\
      305:             <span class=\"ruby-identifier\">split</span>( <span class=\"ruby-regexp re\">%r{/}</span> ).\n\
      306:             <span class=\"ruby-identifier\">first</span>\n\
      307: \n\
      308:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">subpath</span>\n\
      309:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      If the <a href="Transaction.html#M000222">referer</a> was another <a
      href="Transaction.html#M000213">applet</a> under the same <a
      href="../Arrow.html">Arrow</a> instance, return the name of the action that
      preceded the current one. If there was no &#8216;Referer&#8217; header, or
      the <a href="Transaction.html#M000222">referer</a> wasn&#8216;t an <a
      href="Transaction.html#M000213">applet</a> under the same <a
      href="../Arrow.html">Arrow</a> instance, return <tt>nil</tt>.
      </p>
    params: ()
  - visibility: public
    aref: M000216
    name: referring_applet
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 276</span>\n\
      276:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">referring_applet</span>\n\
      277:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">referer</span>\n\
      278:         <span class=\"ruby-identifier\">uri</span> = <span class=\"ruby-constant\">URI</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">referer</span> )\n\
      279:         <span class=\"ruby-identifier\">path</span> = <span class=\"ruby-identifier\">uri</span>.<span class=\"ruby-identifier\">path</span> <span class=\"ruby-keyword kw\">or</span> <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span>\n\
      280:         <span class=\"ruby-identifier\">rootRe</span> = <span class=\"ruby-constant\">Regexp</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">app_root</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">&quot;/&quot;</span> )\n\
      281: \n\
      282:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">rootRe</span>.<span class=\"ruby-identifier\">match</span>( <span class=\"ruby-identifier\">path</span> )\n\
      283:         <span class=\"ruby-identifier\">subpath</span> = <span class=\"ruby-identifier\">path</span>.\n\
      284:             <span class=\"ruby-identifier\">sub</span>( <span class=\"ruby-identifier\">rootRe</span>, <span class=\"ruby-value str\">''</span> ).\n\
      285:             <span class=\"ruby-identifier\">split</span>( <span class=\"ruby-regexp re\">%r{/}</span> ).\n\
      286:             <span class=\"ruby-identifier\">first</span>\n\
      287: \n\
      288:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">subpath</span>\n\
      289:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      If the <a href="Transaction.html#M000222">referer</a> was another <a
      href="Transaction.html#M000213">applet</a> under the same <a
      href="../Arrow.html">Arrow</a> instance, return the uri to it. If there was
      no &#8216;Referer&#8217; header, or the <a
      href="Transaction.html#M000222">referer</a> wasn&#8216;t an <a
      href="Transaction.html#M000213">applet</a> under the same <a
      href="../Arrow.html">Arrow</a> instance, returns <tt>nil</tt>.
      </p>
    params: ()
  - visibility: public
    aref: M000233
    name: refresh
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 494</span>\n\
      494:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">refresh</span>( <span class=\"ruby-identifier\">seconds</span>, <span class=\"ruby-identifier\">url</span>=<span class=\"ruby-keyword kw\">nil</span> )\n\
      495:         <span class=\"ruby-identifier\">seconds</span> = <span class=\"ruby-constant\">Integer</span>( <span class=\"ruby-identifier\">seconds</span> )\n\
      496:         <span class=\"ruby-identifier\">url</span> <span class=\"ruby-operator\">||=</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-value str\">''</span> )\n\
      497:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-operator\">!</span><span class=\"ruby-constant\">URI</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-identifier\">url</span> ).<span class=\"ruby-identifier\">absolute?</span>\n\
      498:             <span class=\"ruby-identifier\">url</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">construct_url</span>( <span class=\"ruby-identifier\">url</span> )\n\
      499:         <span class=\"ruby-keyword kw\">end</span>\n\
      500:         \n\
      501:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_out</span>[<span class=\"ruby-value str\">'Refresh'</span>] = <span class=\"ruby-value str\">&quot;%d;%s&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">seconds</span>, <span class=\"ruby-identifier\">url</span>]\n\
      502:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Set the necessary header to make the displayed page <a
      href="Transaction.html#M000233">refresh</a> to the specified <tt>url</tt>
      in the given number of <tt>seconds</tt>.
      </p>
    params: ( seconds, url=nil )
  - visibility: public
    aref: M000221
    name: remote_ip
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 364</span>\n\
      364:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">remote_ip</span>\n\
      365:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_in</span>[<span class=\"ruby-value str\">'X-Forwarded-For'</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">connection</span>.<span class=\"ruby-identifier\">remote_ip</span>\n\
      366:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Fetch the client&#8216;s IP, either from proxy headers or the
      connection&#8216;s IP.
      </p>
    params: ()
  - visibility: public
    aref: M000225
    name: request_content_type
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 397</span>\n\
      397:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">request_content_type</span>\n\
      398:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">headers_in</span>[<span class=\"ruby-value str\">'Content-type'</span>]\n\
      399:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return the Content-type header given in the request&#8216;s headers, if any
      </p>
    params: ()
  - visibility: public
    aref: M000207
    name: root_dispatcher?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 225</span>\n\
      225:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">root_dispatcher?</span>\n\
      226:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-ivar\">@root_dispatcher</span>\n\
      227:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns <tt>true</tt> if the dispatcher is mounted on the root URI
      (&quot;/&quot;)
      </p>
    params: ()
  - visibility: public
    aref: M000204
    name: session
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 176</span>\n\
      176:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">session</span>( <span class=\"ruby-identifier\">config</span>={} )\n\
      177:         <span class=\"ruby-ivar\">@session</span> <span class=\"ruby-operator\">||=</span> <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Session</span>.<span class=\"ruby-identifier\">create</span>( <span class=\"ruby-keyword kw\">self</span>, <span class=\"ruby-identifier\">config</span> )\n\
      178:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      The <a href="Transaction.html#M000204">session</a> associated with the
      receiver (an <a href="Session.html">Arrow::Session</a> object).
      </p>
    params: ( config={} )
  - visibility: public
    aref: M000203
    name: session?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 170</span>\n\
      170:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">session?</span>\n\
      171:         <span class=\"ruby-ivar\">@session</span> <span class=\"ruby-operator\">?</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      172:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns <tt>true</tt> if a <a href="Transaction.html#M000204">session</a>
      has been created for the receiver.
      </p>
    params: ()
  - visibility: public
    aref: M000230
    name: status_doc
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/transaction.rb, line 454</span>\n\
      454:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">status_doc</span>( <span class=\"ruby-identifier\">status_code</span>, <span class=\"ruby-identifier\">uri</span>=<span class=\"ruby-keyword kw\">nil</span> )\n\
      455:         <span class=\"ruby-identifier\">body</span> = <span class=\"ruby-value str\">''</span>\n\
      456:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">uri</span>\n\
      457:             <span class=\"ruby-identifier\">body</span> = <span class=\"ruby-value str\">%q{&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;}</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">uri</span>, <span class=\"ruby-identifier\">uri</span> ]\n\
      458:         <span class=\"ruby-keyword kw\">end</span>\n\
      459: \n\
      460:         <span class=\"ruby-comment cmt\">#&lt;head&gt;&lt;title&gt;%d %s&lt;/title&gt;&lt;/head&gt;</span>\n\
      461:         <span class=\"ruby-comment cmt\">#&lt;body&gt;&lt;h1&gt;%s&lt;/h1&gt;&lt;p&gt;%s&lt;/p&gt;&lt;/body&gt;</span>\n\
      462:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">HTMLDoc</span> <span class=\"ruby-operator\">%</span> [\n\
      463:             <span class=\"ruby-identifier\">status_code</span>,\n\
      464:             <span class=\"ruby-constant\">StatusName</span>[<span class=\"ruby-identifier\">status_code</span>],\n\
      465:             <span class=\"ruby-constant\">StatusName</span>[<span class=\"ruby-identifier\">status_code</span>],\n\
      466:             <span class=\"ruby-identifier\">body</span>\n\
      467:         ]\n\
      468:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return a minimal HTML doc for representing a given status_code
      </p>
    params: ( status_code, uri=nil )
  category: Instance
  type: Public

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    SVN Revision
    
  value: "%q$Rev: 437 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: transaction.rb 437 2008-03-28 00:49:20Z deveiant $"
- name: HTMLDoc
  value: "&lt;&lt;-&quot;EOF&quot;.gsub(/^\\t/, '')     &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;     &lt;html&gt;       &lt;head&gt;&lt;title&gt;%d %s&lt;/title&gt;&lt;/head&gt;       &lt;body&gt;&lt;h1&gt;%s&lt;/h1&gt;&lt;p&gt;%s&lt;/p&gt;&lt;/body&gt;     &lt;/html&gt;     EOF .gsub(/^\\t/, '')"
- name: StatusName
  desc: |+
    
    Status names
    
  value: "{         300       =&gt; &quot;Multiple Choices&quot;,         301       =&gt; &quot;Moved Permanently&quot;,         302       =&gt; &quot;Found&quot;,         303       =&gt; &quot;See Other&quot;,         304       =&gt; &quot;Not Modified&quot;,         305       =&gt; &quot;Use Proxy&quot;,         307       =&gt; &quot;Temporary Redirect&quot;,     }"
- name: DelegatedMethods
  value: Apache::Request.instance_methods(false) - [             &quot;inspect&quot;, &quot;to_s&quot;
- name: FORM_CONTENT_TYPES
  value: "%r{application/x-www-form-urlencoded|multipart/form-data}i"

[Validate]

Generated with the Darkfish Rdoc Generator.