Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (34 sloc) 7.756 kb
<!DOCTYPE html> <html> <head> <title>index.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="default_inflections.html"> default_inflections.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="inflections.html"> inflections.coffee </a> <a class="source" href="methods.html"> methods.coffee </a> <a class="source" href="number_extensions.html"> number_extensions.coffee </a> <a class="source" href="string_extensions.html"> string_extensions.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nv">Inflections = </span><span class="nx">require</span><span class="p">(</span><span class="s">&#39;./inflections&#39;</span><span class="p">).</span><span class="nx">Inflections</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Yields a singleton instance of Inflections so you can specify additional inflector rules.</p>
<h3>Examples</h3>
<pre><code>inflect.inflections (inflect) -&gt;
inflect.uncountable "rails"
</code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="nv">inflections = </span><span class="nf">(callback) -&gt;</span>
<span class="nx">callback</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">Inflections</span><span class="p">.</span><span class="nx">instance</span><span class="p">())</span> <span class="k">if</span> <span class="nx">callback</span><span class="o">?</span>
<span class="nx">Inflections</span><span class="p">.</span><span class="nx">instance</span><span class="p">()</span>
<span class="nv">exports.Inflections = </span><span class="nx">Inflections</span>
<span class="nv">exports.inflections = </span><span class="nx">inflections</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>methods</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">methods = </span><span class="nx">require</span><span class="p">(</span><span class="s">&#39;./methods&#39;</span><span class="p">)</span>
<span class="nv">exports.camelize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">camelize</span>
<span class="nv">exports.underscore = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">underscore</span>
<span class="nv">exports.dasherize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">dasherize</span>
<span class="nv">exports.titleize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">titleize</span>
<span class="nv">exports.capitalize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">capitalize</span>
<span class="nv">exports.decapitalize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">decapitalize</span>
<span class="nv">exports.pluralize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">pluralize</span>
<span class="nv">exports.singularize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">singularize</span>
<span class="nv">exports.humanize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">humanize</span>
<span class="nv">exports.ordinalize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">ordinalize</span>
<span class="nv">exports.parameterize = </span><span class="nx">methods</span><span class="p">.</span><span class="nx">parameterize</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Base object extensions</p>
<p>These methods can be used to extend the built-in String and Number classes
with additional convenience methods.</p>
<h3>Examples</h3>
<pre><code>1.ordinalize() # =&gt; "1st"
"post".pluralize() # =&gt; "posts"
</code></pre>
<p>They extend Base objects - so use with care and only enable them if you knwo what you are doing.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">string_extensions = </span><span class="nx">require</span><span class="p">(</span><span class="s">&#39;./string_extensions&#39;</span><span class="p">)</span>
<span class="nv">number_extensions = </span><span class="nx">require</span><span class="p">(</span><span class="s">&#39;./number_extensions&#39;</span><span class="p">)</span>
<span class="nv">exports.enableStringExtensions = </span><span class="nx">string_extensions</span><span class="p">.</span><span class="nx">enableStringExtensions</span>
<span class="nv">exports.enableNumberExtensions = </span><span class="nx">number_extensions</span><span class="p">.</span><span class="nx">enableNumberExtensions</span>
<span class="nv">exports.enableExtensions = </span><span class="o">-&gt;</span>
<span class="nx">string_extensions</span><span class="p">.</span><span class="nx">enableStringExtensions</span><span class="p">()</span>
<span class="nx">number_extensions</span><span class="p">.</span><span class="nx">enableNumberExtensions</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>default inflections</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">require</span><span class="p">(</span><span class="s">&#39;./default_inflections&#39;</span><span class="p">)</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
Jump to Line
Something went wrong with that request. Please try again.