Sha256: 10296af45653216987241884b200cb3d3bcc5ebb57395fe942246c25d6f1915e

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

<?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>encode_headers (Rev::HttpEncoding)</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/rev/http_client.rb, line 101</span>
101:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_headers</span>(<span class="ruby-identifier">head</span>)
102:       <span class="ruby-identifier">head</span>.<span class="ruby-identifier">reduce</span>(<span class="ruby-value str">''</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, (<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)<span class="ruby-operator">|</span>
103:         <span class="ruby-comment cmt"># Munge keys from foo-bar-baz to Foo-Bar-Baz</span>
104:         <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'-'</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:capitalize</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">'-'</span>)
105:       <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
106:       <span class="ruby-keyword kw">end</span>
107:     <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rev-0.1.2 doc/rdoc/classes/Rev/HttpEncoding.src/M000017.html