<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>included (Rack::RespondTo::Helpers)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/sinatra/rack_accept.rb, line 53</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>) <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span> <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">:content_type_without_save</span> <span class="ruby-identifier">:content_type</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-identifier">content_type_without_save</span> <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'rack-accept.formats'</span>] = { <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_sym</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span> } <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Content-Type'</span>] <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>