X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/output/Ext.util.Inflector.js?ds=sidebyside diff --git a/docs/output/Ext.util.Inflector.js b/docs/output/Ext.util.Inflector.js new file mode 100644 index 00000000..ce819818 --- /dev/null +++ b/docs/output/Ext.util.Inflector.js @@ -0,0 +1,278 @@ +Ext.data.JsonP.Ext_util_Inflector({ + "tagname": "class", + "name": "Ext.util.Inflector", + "doc": "
General purpose inflector class that pluralizes, singularizes and \nordinalizes words. Sample usage:
\n\n\n\n\n//turning singular words into plurals\nExt.util.Inflector.pluralize('word'); //'words'\nExt.util.Inflector.pluralize('person'); //'people'\nExt.util.Inflector.pluralize('sheep'); //'sheep'\n\n//turning plurals into singulars\nExt.util.Inflector.singularize('words'); //'word'\nExt.util.Inflector.singularize('people'); //'person'\nExt.util.Inflector.singularize('sheep'); //'sheep'\n\n//ordinalizing numbers\nExt.util.Inflector.ordinalize(11); //\"11th\"\nExt.util.Inflector.ordinalize(21); //\"21th\"\nExt.util.Inflector.ordinalize(1043); //\"1043rd\"\n
\n\n\n\n\nCustomization
\n\n\n\n\nThe Inflector comes with a default set of US English pluralization rules. These can be augmented with additional\nrules if the default rules do not meet your application's requirements, or swapped out entirely for other languages.\nHere is how we might add a rule that pluralizes \"ox\" to \"oxen\":
\n\n\n\n\nExt.util.Inflector.plural(/^(ox)$/i, \"$1en\");\n
\n\n\n\n\nEach rule consists of two items - a regular expression that matches one or more rules, and a replacement string.\nIn this case, the regular expression will only match the string \"ox\", and will replace that match with \"oxen\". \nHere's how we could add the inverse rule:
\n\n\n\n\nExt.util.Inflector.singular(/^(ox)en$/i, \"$1\");\n
\n\n\n\n\nNote that the ox/oxen rules are present by default.
\n\n", + "extends": "Object", + "mixins": [ + + ], + "alternateClassNames": [ + + ], + "xtype": null, + "author": null, + "docauthor": null, + "singleton": true, + "private": false, + "cfg": [ + + ], + "method": [ + { + "tagname": "method", + "name": "classify", + "member": "Ext.util.Inflector", + "doc": "Returns the correct Model name for a given string. Mostly used internally by the data\npackage
\n", + "params": [ + { + "type": "String", + "name": "word", + "doc": "The word to classify
\n", + "optional": false + } + ], + "return": { + "type": "String", + "doc": "The classified version of the word
\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 237, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-classify", + "shortDoc": "Returns the correct Model name for a given string. Mostly used internally by the data\npackage
\n" + }, + { + "tagname": "method", + "name": "clearPlurals", + "member": "Ext.util.Inflector", + "doc": "Removes all registered pluralization rules
\n", + "params": [ + + ], + "return": { + "type": "void", + "doc": "\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 169, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-clearPlurals", + "shortDoc": "Removes all registered pluralization rules
\n" + }, + { + "tagname": "method", + "name": "clearSingulars", + "member": "Ext.util.Inflector", + "doc": "Removes all registered singularization rules
\n", + "params": [ + + ], + "return": { + "type": "void", + "doc": "\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 162, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-clearSingulars", + "shortDoc": "Removes all registered singularization rules
\n" + }, + { + "tagname": "method", + "name": "isTransnumeral", + "member": "Ext.util.Inflector", + "doc": "Returns true if the given word is transnumeral (the word is its own singular and plural form - e.g. sheep, fish)
\n", + "params": [ + { + "type": "String", + "name": "word", + "doc": "The word to test
\n", + "optional": false + } + ], + "return": { + "type": "Boolean", + "doc": "True if the word is transnumeral
\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 176, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-isTransnumeral", + "shortDoc": "Returns true if the given word is transnumeral (the word is its own singular and plural form - e.g. sheep, fish)
\n" + }, + { + "tagname": "method", + "name": "ordinalize", + "member": "Ext.util.Inflector", + "doc": "Ordinalizes a given number by adding a prefix such as 'st', 'nd', 'rd' or 'th' based on the last digit of the\nnumber. 21 -> 21st, 22 -> 22nd, 23 -> 23rd, 24 -> 24th etc
\n", + "params": [ + { + "type": "Number", + "name": "number", + "doc": "The number to ordinalize
\n", + "optional": false + } + ], + "return": { + "type": "String", + "doc": "The ordinalized number
\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 247, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-ordinalize", + "shortDoc": "Ordinalizes a given number by adding a prefix such as 'st', 'nd', 'rd' or 'th' based on the last digit of the\nnumber...." + }, + { + "tagname": "method", + "name": "plural", + "member": "Ext.util.Inflector", + "doc": "Adds a new pluralization rule to the Inflector. See the intro docs for more information
\n", + "params": [ + { + "type": "RegExp", + "name": "matcher", + "doc": "The matcher regex
\n", + "optional": false + }, + { + "type": "String", + "name": "replacer", + "doc": "The replacement string, which can reference matches from the matcher argument
\n", + "optional": false + } + ], + "return": { + "type": "void", + "doc": "\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 153, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-plural", + "shortDoc": "Adds a new pluralization rule to the Inflector. See the intro docs for more information
\n" + }, + { + "tagname": "method", + "name": "pluralize", + "member": "Ext.util.Inflector", + "doc": "Returns the pluralized form of a word (e.g. Ext.util.Inflector.pluralize('word') returns 'words')
\n", + "params": [ + { + "type": "String", + "name": "word", + "doc": "The word to pluralize
\n", + "optional": false + } + ], + "return": { + "type": "String", + "doc": "The pluralized form of the word
\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 185, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-pluralize", + "shortDoc": "Returns the pluralized form of a word (e.g. Ext.util.Inflector.pluralize('word') returns 'words')
\n" + }, + { + "tagname": "method", + "name": "singular", + "member": "Ext.util.Inflector", + "doc": "Adds a new singularization rule to the Inflector. See the intro docs for more information
\n", + "params": [ + { + "type": "RegExp", + "name": "matcher", + "doc": "The matcher regex
\n", + "optional": false + }, + { + "type": "String", + "name": "replacer", + "doc": "The replacement string, which can reference matches from the matcher argument
\n", + "optional": false + } + ], + "return": { + "type": "void", + "doc": "\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 144, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-singular", + "shortDoc": "Adds a new singularization rule to the Inflector. See the intro docs for more information
\n" + }, + { + "tagname": "method", + "name": "singularize", + "member": "Ext.util.Inflector", + "doc": "Returns the singularized form of a word (e.g. Ext.util.Inflector.singularize('words') returns 'word')
\n", + "params": [ + { + "type": "String", + "name": "word", + "doc": "The word to singularize
\n", + "optional": false + } + ], + "return": { + "type": "String", + "doc": "The singularized form of the word
\n" + }, + "private": false, + "static": false, + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 211, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector-method-singularize", + "shortDoc": "Returns the singularized form of a word (e.g. Ext.util.Inflector.singularize('words') returns 'word')
\n" + } + ], + "property": [ + + ], + "event": [ + + ], + "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Inflector.js", + "linenr": 1, + "html_filename": "Inflector.html", + "href": "Inflector.html#Ext-util-Inflector", + "cssVar": [ + + ], + "cssMixin": [ + + ], + "component": false, + "superclasses": [ + + ], + "subclasses": [ + + ], + "mixedInto": [ + + ], + "allMixins": [ + + ] +}); \ No newline at end of file