Method: Arrow::Transaction#referring_applet

Defined in:
lib/arrow/transaction.rb

#referring_appletObject

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.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/arrow/transaction.rb', line 268

def referring_applet
	return nil unless self.referer
	uri = URI.parse( self.referer )
	path = uri.path or return nil
	rootRe = Regexp.new( self.app_root + "/" )

	return nil unless rootRe.match( path )
	subpath = path.
		sub( rootRe, '' ).
		split( %r{/} ).
		first

	return subpath
end