mack-facets 0.7.1 → 0.7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metadata +2 -47
- data/doc/classes/Array.html +0 -408
- data/doc/classes/Class.html +0 -233
- data/doc/classes/Hash.html +0 -233
- data/doc/classes/Kernel.html +0 -212
- data/doc/classes/Mack/Facets/DateTime.html +0 -168
- data/doc/classes/Mack/Facets.html +0 -111
- data/doc/classes/Mack/Utils/BlankSlate.html +0 -113
- data/doc/classes/Mack/Utils/Inflector.html +0 -382
- data/doc/classes/Mack/Utils/RegistryList.html +0 -469
- data/doc/classes/Mack/Utils/RegistryMap.html +0 -479
- data/doc/classes/Math.html +0 -188
- data/doc/classes/Module.html +0 -203
- data/doc/classes/NilClass.html +0 -148
- data/doc/classes/Object.html +0 -558
- data/doc/classes/String.html +0 -464
- data/doc/classes/Symbol.html +0 -148
- data/doc/classes/Time.html +0 -204
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -112
- data/doc/files/lib/mack-facets/english_extensions/inflect_rb.html +0 -101
- data/doc/files/lib/mack-facets/english_extensions/numerals_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/array_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/class_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/date_time_rb.html +0 -129
- data/doc/files/lib/mack-facets/extensions/hash_rb.html +0 -108
- data/doc/files/lib/mack-facets/extensions/kernel_rb.html +0 -109
- data/doc/files/lib/mack-facets/extensions/math_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/module_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/nil_class_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/object_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/string_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/symbol_rb.html +0 -101
- data/doc/files/lib/mack-facets/extensions/time_rb.html +0 -108
- data/doc/files/lib/mack-facets/utils/blank_slate_rb.html +0 -101
- data/doc/files/lib/mack-facets/utils/inflections_rb.html +0 -101
- data/doc/files/lib/mack-facets/utils/inflector_rb.html +0 -108
- data/doc/files/lib/mack-facets/utils/options_merger_rb.html +0 -101
- data/doc/files/lib/mack-facets/utils/registry_list_rb.html +0 -108
- data/doc/files/lib/mack-facets/utils/registry_map_rb.html +0 -108
- data/doc/files/lib/mack-facets_rb.html +0 -124
- data/doc/fr_class_index.html +0 -43
- data/doc/fr_file_index.html +0 -48
- data/doc/fr_method_index.html +0 -104
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
| @@ -1,382 +0,0 @@ | |
| 1 | 
            -
            <?xml version="1.0" encoding="iso-8859-1"?>
         | 
| 2 | 
            -
            <!DOCTYPE html 
         | 
| 3 | 
            -
                 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         | 
| 4 | 
            -
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         | 
| 7 | 
            -
            <head>
         | 
| 8 | 
            -
              <title>Class: Mack::Utils::Inflector</title>
         | 
| 9 | 
            -
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         | 
| 10 | 
            -
              <meta http-equiv="Content-Script-Type" content="text/javascript" />
         | 
| 11 | 
            -
              <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
         | 
| 12 | 
            -
              <script type="text/javascript">
         | 
| 13 | 
            -
              // <![CDATA[
         | 
| 14 | 
            -
             | 
| 15 | 
            -
              function popupCode( url ) {
         | 
| 16 | 
            -
                window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
         | 
| 17 | 
            -
              }
         | 
| 18 | 
            -
             | 
| 19 | 
            -
              function toggleCode( id ) {
         | 
| 20 | 
            -
                if ( document.getElementById )
         | 
| 21 | 
            -
                  elem = document.getElementById( id );
         | 
| 22 | 
            -
                else if ( document.all )
         | 
| 23 | 
            -
                  elem = eval( "document.all." + id );
         | 
| 24 | 
            -
                else
         | 
| 25 | 
            -
                  return false;
         | 
| 26 | 
            -
             | 
| 27 | 
            -
                elemStyle = elem.style;
         | 
| 28 | 
            -
                
         | 
| 29 | 
            -
                if ( elemStyle.display != "block" ) {
         | 
| 30 | 
            -
                  elemStyle.display = "block"
         | 
| 31 | 
            -
                } else {
         | 
| 32 | 
            -
                  elemStyle.display = "none"
         | 
| 33 | 
            -
                }
         | 
| 34 | 
            -
             | 
| 35 | 
            -
                return true;
         | 
| 36 | 
            -
              }
         | 
| 37 | 
            -
              
         | 
| 38 | 
            -
              // Make codeblocks hidden by default
         | 
| 39 | 
            -
              document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
         | 
| 40 | 
            -
              
         | 
| 41 | 
            -
              // ]]>
         | 
| 42 | 
            -
              </script>
         | 
| 43 | 
            -
             | 
| 44 | 
            -
            </head>
         | 
| 45 | 
            -
            <body>
         | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
                <div id="classHeader">
         | 
| 50 | 
            -
                    <table class="header-table">
         | 
| 51 | 
            -
                    <tr class="top-aligned-row">
         | 
| 52 | 
            -
                      <td><strong>Class</strong></td>
         | 
| 53 | 
            -
                      <td class="class-name-in-header">Mack::Utils::Inflector</td>
         | 
| 54 | 
            -
                    </tr>
         | 
| 55 | 
            -
                    <tr class="top-aligned-row">
         | 
| 56 | 
            -
                        <td><strong>In:</strong></td>
         | 
| 57 | 
            -
                        <td>
         | 
| 58 | 
            -
                            <a href="../../../files/lib/mack-facets/utils/inflector_rb.html">
         | 
| 59 | 
            -
                            lib/mack-facets/utils/inflector.rb
         | 
| 60 | 
            -
                            </a>
         | 
| 61 | 
            -
                    <br />
         | 
| 62 | 
            -
                        </td>
         | 
| 63 | 
            -
                    </tr>
         | 
| 64 | 
            -
             | 
| 65 | 
            -
                    <tr class="top-aligned-row">
         | 
| 66 | 
            -
                        <td><strong>Parent:</strong></td>
         | 
| 67 | 
            -
                        <td>
         | 
| 68 | 
            -
                            <a href="../../Object.html">
         | 
| 69 | 
            -
                            Object
         | 
| 70 | 
            -
                           </a>
         | 
| 71 | 
            -
                        </td>
         | 
| 72 | 
            -
                    </tr>
         | 
| 73 | 
            -
                    </table>
         | 
| 74 | 
            -
                </div>
         | 
| 75 | 
            -
              <!-- banner header -->
         | 
| 76 | 
            -
             | 
| 77 | 
            -
              <div id="bodyContent">
         | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
              <div id="contextContent">
         | 
| 82 | 
            -
             | 
| 83 | 
            -
                <div id="description">
         | 
| 84 | 
            -
                  <p>
         | 
| 85 | 
            -
            This class is used to deal with inflection strings. This means taken a
         | 
| 86 | 
            -
            string and make it <a href="Inflector.html#M000054">plural</a>, or <a
         | 
| 87 | 
            -
            href="Inflector.html#M000055">singular</a>, etc… Inflection rules can
         | 
| 88 | 
            -
            be added very easy, and are checked from the bottom up. This means that the
         | 
| 89 | 
            -
            last rule is the first rule to be matched. The exception to this, kind of,
         | 
| 90 | 
            -
            is ‘<a href="Inflector.html#M000056">irregular</a>’ and
         | 
| 91 | 
            -
            ‘uncountable’ rules. The ‘uncountable’ rules are
         | 
| 92 | 
            -
            always checked first, then the ‘<a
         | 
| 93 | 
            -
            href="Inflector.html#M000056">irregular</a>’ rules, and finally
         | 
| 94 | 
            -
            either the ‘<a href="Inflector.html#M000055">singular</a>’ or
         | 
| 95 | 
            -
            ‘<a href="Inflector.html#M000054">plural</a>’ rules, depending
         | 
| 96 | 
            -
            on what you‘re trying to do. Within each of these sets of rules, the
         | 
| 97 | 
            -
            last rule in is the first rule matched.
         | 
| 98 | 
            -
            </p>
         | 
| 99 | 
            -
            <p>
         | 
| 100 | 
            -
            Example:
         | 
| 101 | 
            -
            </p>
         | 
| 102 | 
            -
            <pre>
         | 
| 103 | 
            -
              Mack::Utils::Inflector.inflections do |inflect|
         | 
| 104 | 
            -
                inflect.plural(/$/, 's')
         | 
| 105 | 
            -
                inflect.plural(/^(ox)$/i, '\1en')
         | 
| 106 | 
            -
                inflect.plural(/(phenomen|criteri)on$/i, '\1a')
         | 
| 107 | 
            -
             | 
| 108 | 
            -
                inflect.singular(/s$/i, '')
         | 
| 109 | 
            -
                inflect.singular(/(n)ews$/i, '\1ews')
         | 
| 110 | 
            -
                inflect.singular(/^(.*)ookies$/, '\1ookie')
         | 
| 111 | 
            -
             | 
| 112 | 
            -
                inflect.irregular('person', 'people')
         | 
| 113 | 
            -
                inflect.irregular('child', 'children')
         | 
| 114 | 
            -
              end
         | 
| 115 | 
            -
            </pre>
         | 
| 116 | 
            -
             | 
| 117 | 
            -
                </div>
         | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 120 | 
            -
               </div>
         | 
| 121 | 
            -
             | 
| 122 | 
            -
                <div id="method-list">
         | 
| 123 | 
            -
                  <h3 class="section-bar">Methods</h3>
         | 
| 124 | 
            -
             | 
| 125 | 
            -
                  <div class="name-list">
         | 
| 126 | 
            -
                  <a href="#M000059">inflections</a>  
         | 
| 127 | 
            -
                  <a href="#M000056">irregular</a>  
         | 
| 128 | 
            -
                  <a href="#M000054">plural</a>  
         | 
| 129 | 
            -
                  <a href="#M000058">pluralize</a>  
         | 
| 130 | 
            -
                  <a href="#M000055">singular</a>  
         | 
| 131 | 
            -
                  <a href="#M000057">singularize</a>  
         | 
| 132 | 
            -
                  </div>
         | 
| 133 | 
            -
                </div>
         | 
| 134 | 
            -
             | 
| 135 | 
            -
              </div>
         | 
| 136 | 
            -
             | 
| 137 | 
            -
             | 
| 138 | 
            -
                <!-- if includes -->
         | 
| 139 | 
            -
                <div id="includes">
         | 
| 140 | 
            -
                  <h3 class="section-bar">Included Modules</h3>
         | 
| 141 | 
            -
             | 
| 142 | 
            -
                  <div id="includes-list">
         | 
| 143 | 
            -
                    <span class="include-name">Singleton</span>
         | 
| 144 | 
            -
                  </div>
         | 
| 145 | 
            -
                </div>
         | 
| 146 | 
            -
             | 
| 147 | 
            -
                <div id="section">
         | 
| 148 | 
            -
             | 
| 149 | 
            -
             | 
| 150 | 
            -
             | 
| 151 | 
            -
             | 
| 152 | 
            -
             | 
| 153 | 
            -
                  
         | 
| 154 | 
            -
             | 
| 155 | 
            -
             | 
| 156 | 
            -
                <!-- if method_list -->
         | 
| 157 | 
            -
                <div id="methods">
         | 
| 158 | 
            -
                  <h3 class="section-bar">Public Class methods</h3>
         | 
| 159 | 
            -
             | 
| 160 | 
            -
                  <div id="method-M000059" class="method-detail">
         | 
| 161 | 
            -
                    <a name="M000059"></a>
         | 
| 162 | 
            -
             | 
| 163 | 
            -
                    <div class="method-heading">
         | 
| 164 | 
            -
                      <a href="#M000059" class="method-signature">
         | 
| 165 | 
            -
                      <span class="method-name">inflections</span><span class="method-args">() {|Mack::Utils::Inflector.instance| ...}</span>
         | 
| 166 | 
            -
                      </a>
         | 
| 167 | 
            -
                    </div>
         | 
| 168 | 
            -
                  
         | 
| 169 | 
            -
                    <div class="method-description">
         | 
| 170 | 
            -
                      <p>
         | 
| 171 | 
            -
            Yields up Mack::Utils::Inflector.instance
         | 
| 172 | 
            -
            </p>
         | 
| 173 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 174 | 
            -
                        onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
         | 
| 175 | 
            -
                      <div class="method-source-code" id="M000059-source">
         | 
| 176 | 
            -
            <pre>
         | 
| 177 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 87</span>
         | 
| 178 | 
            -
            87:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inflections</span>
         | 
| 179 | 
            -
            88:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
         | 
| 180 | 
            -
            89:             <span class="ruby-keyword kw">yield</span> <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflector</span>.<span class="ruby-identifier">instance</span>
         | 
| 181 | 
            -
            90:           <span class="ruby-keyword kw">else</span>
         | 
| 182 | 
            -
            91:             <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflector</span>.<span class="ruby-identifier">instance</span>
         | 
| 183 | 
            -
            92:           <span class="ruby-keyword kw">end</span>
         | 
| 184 | 
            -
            93:         <span class="ruby-keyword kw">end</span>
         | 
| 185 | 
            -
            </pre>
         | 
| 186 | 
            -
                      </div>
         | 
| 187 | 
            -
                    </div>
         | 
| 188 | 
            -
                  </div>
         | 
| 189 | 
            -
             | 
| 190 | 
            -
                  <h3 class="section-bar">Public Instance methods</h3>
         | 
| 191 | 
            -
             | 
| 192 | 
            -
                  <div id="method-M000056" class="method-detail">
         | 
| 193 | 
            -
                    <a name="M000056"></a>
         | 
| 194 | 
            -
             | 
| 195 | 
            -
                    <div class="method-heading">
         | 
| 196 | 
            -
                      <a href="#M000056" class="method-signature">
         | 
| 197 | 
            -
                      <span class="method-name">irregular</span><span class="method-args">(rule, replacement)</span>
         | 
| 198 | 
            -
                      </a>
         | 
| 199 | 
            -
                    </div>
         | 
| 200 | 
            -
                  
         | 
| 201 | 
            -
                    <div class="method-description">
         | 
| 202 | 
            -
                      <p>
         | 
| 203 | 
            -
            Adds a <a href="Inflector.html#M000056">irregular</a> rule to the system.
         | 
| 204 | 
            -
            </p>
         | 
| 205 | 
            -
            <p>
         | 
| 206 | 
            -
            Example:
         | 
| 207 | 
            -
            </p>
         | 
| 208 | 
            -
            <pre>
         | 
| 209 | 
            -
              Mack::Utils::Inflector.inflections do |inflect|
         | 
| 210 | 
            -
                inflect.irregular('person', 'people')
         | 
| 211 | 
            -
                inflect.irregular('child', 'children')
         | 
| 212 | 
            -
              end
         | 
| 213 | 
            -
            </pre>
         | 
| 214 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 215 | 
            -
                        onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
         | 
| 216 | 
            -
                      <div class="method-source-code" id="M000056-source">
         | 
| 217 | 
            -
            <pre>
         | 
| 218 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 58</span>
         | 
| 219 | 
            -
            58:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">irregular</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 220 | 
            -
            59:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">rule</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 221 | 
            -
            60:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">word</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 222 | 
            -
            61:       <span class="ruby-keyword kw">end</span>
         | 
| 223 | 
            -
            </pre>
         | 
| 224 | 
            -
                      </div>
         | 
| 225 | 
            -
                    </div>
         | 
| 226 | 
            -
                  </div>
         | 
| 227 | 
            -
             | 
| 228 | 
            -
                  <div id="method-M000054" class="method-detail">
         | 
| 229 | 
            -
                    <a name="M000054"></a>
         | 
| 230 | 
            -
             | 
| 231 | 
            -
                    <div class="method-heading">
         | 
| 232 | 
            -
                      <a href="#M000054" class="method-signature">
         | 
| 233 | 
            -
                      <span class="method-name">plural</span><span class="method-args">(rule, replacement)</span>
         | 
| 234 | 
            -
                      </a>
         | 
| 235 | 
            -
                    </div>
         | 
| 236 | 
            -
                  
         | 
| 237 | 
            -
                    <div class="method-description">
         | 
| 238 | 
            -
                      <p>
         | 
| 239 | 
            -
            Adds a <a href="Inflector.html#M000054">plural</a> rule to the system.
         | 
| 240 | 
            -
            </p>
         | 
| 241 | 
            -
            <p>
         | 
| 242 | 
            -
            Example:
         | 
| 243 | 
            -
            </p>
         | 
| 244 | 
            -
            <pre>
         | 
| 245 | 
            -
              Mack::Utils::Inflector.inflections do |inflect|
         | 
| 246 | 
            -
                inflect.plural(/$/, 's')
         | 
| 247 | 
            -
                inflect.plural(/^(ox)$/i, '\1en')
         | 
| 248 | 
            -
                inflect.plural(/(phenomen|criteri)on$/i, '\1a')
         | 
| 249 | 
            -
              end
         | 
| 250 | 
            -
            </pre>
         | 
| 251 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 252 | 
            -
                        onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
         | 
| 253 | 
            -
                      <div class="method-source-code" id="M000054-source">
         | 
| 254 | 
            -
            <pre>
         | 
| 255 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 35</span>
         | 
| 256 | 
            -
            35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plural</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 257 | 
            -
            36:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">plural_rule</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 258 | 
            -
            37:       <span class="ruby-keyword kw">end</span>
         | 
| 259 | 
            -
            </pre>
         | 
| 260 | 
            -
                      </div>
         | 
| 261 | 
            -
                    </div>
         | 
| 262 | 
            -
                  </div>
         | 
| 263 | 
            -
             | 
| 264 | 
            -
                  <div id="method-M000058" class="method-detail">
         | 
| 265 | 
            -
                    <a name="M000058"></a>
         | 
| 266 | 
            -
             | 
| 267 | 
            -
                    <div class="method-heading">
         | 
| 268 | 
            -
                      <a href="#M000058" class="method-signature">
         | 
| 269 | 
            -
                      <span class="method-name">pluralize</span><span class="method-args">(word)</span>
         | 
| 270 | 
            -
                      </a>
         | 
| 271 | 
            -
                    </div>
         | 
| 272 | 
            -
                  
         | 
| 273 | 
            -
                    <div class="method-description">
         | 
| 274 | 
            -
                      <p>
         | 
| 275 | 
            -
            Returns the <a href="Inflector.html#M000055">singular</a> version of the
         | 
| 276 | 
            -
            word, if possible.
         | 
| 277 | 
            -
            </p>
         | 
| 278 | 
            -
            <p>
         | 
| 279 | 
            -
            Examples:
         | 
| 280 | 
            -
            </p>
         | 
| 281 | 
            -
            <pre>
         | 
| 282 | 
            -
              Mack::Utils::Inflector.instance.pluralize("army") # => "armies"
         | 
| 283 | 
            -
              Mack::Utils::Inflector.instance.pluralize("person") # => "people"
         | 
| 284 | 
            -
              Mack::Utils::Inflector.instance.pluralize("boat") # => "boats"
         | 
| 285 | 
            -
            </pre>
         | 
| 286 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 287 | 
            -
                        onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
         | 
| 288 | 
            -
                      <div class="method-source-code" id="M000058-source">
         | 
| 289 | 
            -
            <pre>
         | 
| 290 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 79</span>
         | 
| 291 | 
            -
            79:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">word</span>)
         | 
| 292 | 
            -
            80:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">plural</span>(<span class="ruby-identifier">word</span>)
         | 
| 293 | 
            -
            81:       <span class="ruby-keyword kw">end</span>
         | 
| 294 | 
            -
            </pre>
         | 
| 295 | 
            -
                      </div>
         | 
| 296 | 
            -
                    </div>
         | 
| 297 | 
            -
                  </div>
         | 
| 298 | 
            -
             | 
| 299 | 
            -
                  <div id="method-M000055" class="method-detail">
         | 
| 300 | 
            -
                    <a name="M000055"></a>
         | 
| 301 | 
            -
             | 
| 302 | 
            -
                    <div class="method-heading">
         | 
| 303 | 
            -
                      <a href="#M000055" class="method-signature">
         | 
| 304 | 
            -
                      <span class="method-name">singular</span><span class="method-args">(rule, replacement)</span>
         | 
| 305 | 
            -
                      </a>
         | 
| 306 | 
            -
                    </div>
         | 
| 307 | 
            -
                  
         | 
| 308 | 
            -
                    <div class="method-description">
         | 
| 309 | 
            -
                      <p>
         | 
| 310 | 
            -
            Adds a <a href="Inflector.html#M000055">singular</a> rule to the system.
         | 
| 311 | 
            -
            </p>
         | 
| 312 | 
            -
            <p>
         | 
| 313 | 
            -
            Example:
         | 
| 314 | 
            -
            </p>
         | 
| 315 | 
            -
            <pre>
         | 
| 316 | 
            -
              Mack::Utils::Inflector.inflections do |inflect|
         | 
| 317 | 
            -
                inflect.singular(/s$/i, '')
         | 
| 318 | 
            -
                inflect.singular(/(n)ews$/i, '\1ews')
         | 
| 319 | 
            -
                inflect.singular(/^(.*)ookies$/, '\1ookie')
         | 
| 320 | 
            -
              end
         | 
| 321 | 
            -
            </pre>
         | 
| 322 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 323 | 
            -
                        onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
         | 
| 324 | 
            -
                      <div class="method-source-code" id="M000055-source">
         | 
| 325 | 
            -
            <pre>
         | 
| 326 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 47</span>
         | 
| 327 | 
            -
            47:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singular</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 328 | 
            -
            48:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">singular_rule</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)
         | 
| 329 | 
            -
            49:       <span class="ruby-keyword kw">end</span>
         | 
| 330 | 
            -
            </pre>
         | 
| 331 | 
            -
                      </div>
         | 
| 332 | 
            -
                    </div>
         | 
| 333 | 
            -
                  </div>
         | 
| 334 | 
            -
             | 
| 335 | 
            -
                  <div id="method-M000057" class="method-detail">
         | 
| 336 | 
            -
                    <a name="M000057"></a>
         | 
| 337 | 
            -
             | 
| 338 | 
            -
                    <div class="method-heading">
         | 
| 339 | 
            -
                      <a href="#M000057" class="method-signature">
         | 
| 340 | 
            -
                      <span class="method-name">singularize</span><span class="method-args">(word)</span>
         | 
| 341 | 
            -
                      </a>
         | 
| 342 | 
            -
                    </div>
         | 
| 343 | 
            -
                  
         | 
| 344 | 
            -
                    <div class="method-description">
         | 
| 345 | 
            -
                      <p>
         | 
| 346 | 
            -
            Returns the <a href="Inflector.html#M000055">singular</a> version of the
         | 
| 347 | 
            -
            word, if possible.
         | 
| 348 | 
            -
            </p>
         | 
| 349 | 
            -
            <p>
         | 
| 350 | 
            -
            Examples:
         | 
| 351 | 
            -
            </p>
         | 
| 352 | 
            -
            <pre>
         | 
| 353 | 
            -
              Mack::Utils::Inflector.instance.singularize("armies") # => "army"
         | 
| 354 | 
            -
              Mack::Utils::Inflector.instance.singularize("people") # => "person"
         | 
| 355 | 
            -
              Mack::Utils::Inflector.instance.singularize("boats") # => "boat"
         | 
| 356 | 
            -
            </pre>
         | 
| 357 | 
            -
                      <p><a class="source-toggle" href="#"
         | 
| 358 | 
            -
                        onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
         | 
| 359 | 
            -
                      <div class="method-source-code" id="M000057-source">
         | 
| 360 | 
            -
            <pre>
         | 
| 361 | 
            -
                <span class="ruby-comment cmt"># File lib/mack-facets/utils/inflector.rb, line 69</span>
         | 
| 362 | 
            -
            69:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">word</span>)
         | 
| 363 | 
            -
            70:         <span class="ruby-constant">English</span><span class="ruby-operator">::</span><span class="ruby-constant">Inflect</span>.<span class="ruby-identifier">singular</span>(<span class="ruby-identifier">word</span>)
         | 
| 364 | 
            -
            71:       <span class="ruby-keyword kw">end</span>
         | 
| 365 | 
            -
            </pre>
         | 
| 366 | 
            -
                      </div>
         | 
| 367 | 
            -
                    </div>
         | 
| 368 | 
            -
                  </div>
         | 
| 369 | 
            -
             | 
| 370 | 
            -
             | 
| 371 | 
            -
                </div>
         | 
| 372 | 
            -
             | 
| 373 | 
            -
             | 
| 374 | 
            -
              </div>
         | 
| 375 | 
            -
             | 
| 376 | 
            -
             | 
| 377 | 
            -
            <div id="validator-badges">
         | 
| 378 | 
            -
              <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
         | 
| 379 | 
            -
            </div>
         | 
| 380 | 
            -
             | 
| 381 | 
            -
            </body>
         | 
| 382 | 
            -
            </html>
         |