-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
179 lines (128 loc) · 6.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html>
<head>
<title>index.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="index.html">
index.coffee
</a>
<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>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>index.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
</div>
<div class="content"><div class='highlight'><pre>Inflections = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./inflections'</span>).Inflections</pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>Yields a singleton instance of Inflections so you can specify additional inflector rules.</p>
<h3 id="examples">Examples</h3>
<pre><code>inflect.inflections (inflect) ->
inflect.uncountable <span class="hljs-string">"rails"</span>
</code></pre>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">inflections</span> = <span class="hljs-params">(callback)</span> -></span>
callback.call(<span class="hljs-keyword">this</span>, Inflections.instance()) <span class="hljs-keyword">if</span> callback?
Inflections.instance()
exports.Inflections = Inflections
exports.inflections = inflections</pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>methods</p>
</div>
<div class="content"><div class='highlight'><pre>methods = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./methods'</span>)
exports.camelize = methods.camelize
exports.underscore = methods.underscore
exports.dasherize = methods.dasherize
exports.titleize = methods.titleize
exports.capitalize = methods.capitalize
exports.decapitalize = methods.decapitalize
exports.pluralize = methods.pluralize
exports.singularize = methods.singularize
exports.humanize = methods.humanize
exports.ordinalize = methods.ordinalize
exports.parameterize = methods.parameterize</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</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 id="examples">Examples</h3>
<pre><code><span class="hljs-number">1.</span>ordinalize() <span class="hljs-comment"># => "1st"</span>
<span class="hljs-string">"post"</span>.pluralize() <span class="hljs-comment"># => "posts"</span>
</code></pre><p>They extend Base objects - so use with care and only enable them if you knwo what you are doing.</p>
</div>
<div class="content"><div class='highlight'><pre>string_extensions = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./string_extensions'</span>)
number_extensions = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./number_extensions'</span>)
exports.enableStringExtensions = string_extensions.enableStringExtensions
exports.enableNumberExtensions = number_extensions.enableNumberExtensions
exports.enableExtensions = <span class="hljs-function">-></span>
string_extensions.enableStringExtensions()
number_extensions.enableNumberExtensions()</pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>default inflections</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">require</span>(<span class="hljs-string">'./default_inflections'</span>)</pre></div></div>
</li>
</ul>
</div>
</body>
</html>