Sha256: 69eb7012d3add39502371e7d7f742b18a18ef00ce23ac9f7bdd7f3986ec3f272
Contents?: true
Size: 1.38 KB
Versions: 4
Compression:
Stored size: 1.38 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>camelcase (String)</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/facet/string/camelcase.rb, line 16</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">camelcase</span>(<span class="ruby-identifier">first</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">on</span>=<span class="ruby-value str">'_\s'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span> <span class="ruby-identifier">gsub</span>(<span class="ruby-node">/(^|[#{on}]+)([A-Za-z])/</span>){ <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> } <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">gsub</span>(<span class="ruby-node">/([#{on}]+)([A-Za-z])/</span>){ <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> } <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
4 entries across 4 versions & 1 rubygems