Sha256: f4e085b3ee792ae5c2e3ef8fc5a92c3a67a1628c711a99b9dff1a3c29dddaa6f
Contents?: true
Size: 1.55 KB
Versions: 4
Compression:
Stored size: 1.55 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 (Symbol)</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/symbol/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">to_s</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-identifier">to_sym</span> <span class="ruby-keyword kw">else</span> (<span class="ruby-identifier">to_s</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-identifier">to_sym</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