Clear Up
SharpKit Reference

Inflector Class

Namespace: Ext.util

Base Types

System.Object

Constructors

Name Description
Inflector()

Methods

Name Description
classify(JsString) Returns the correct {@link Ext.data.Model Model} name for a given string. Mostly used internally by the data package @param {String} word The word to classify @return {String} The classified version of the word
clearPlurals() Removes all registered pluralization rules
clearSingulars() Removes all registered singularization rules
isTransnumeral(JsString) Returns true if the given word is transnumeral (the word is its own singular and plural form - e.g. sheep, fish) @param {String} word The word to test @return {Boolean} True if the word is transnumeral
ordinalize(JsNumber) Ordinalizes a given number by adding a prefix such as 'st', 'nd', 'rd' or 'th' based on the last digit of the number. 21 -> 21st, 22 -> 22nd, 23 -> 23rd, 24 -> 24th etc @param {Number} number The number to ordinalize @return {String} The ordinalized number
plural(JsRegExp, JsString) Adds a new pluralization rule to the Inflector. See the intro docs for more information @param {RegExp} matcher The matcher regex @param {String} replacer The replacement string, which can reference matches from the matcher argument
pluralize(JsString) Returns the pluralized form of a word (e.g. Ext.util.Inflector.pluralize('word') returns 'words') @param {String} word The word to pluralize @return {String} The pluralized form of the word
singular(JsRegExp, JsString) Adds a new singularization rule to the Inflector. See the intro docs for more information @param {RegExp} matcher The matcher regex @param {String} replacer The replacement string, which can reference matches from the matcher argument
singularize(JsString) Returns the singularized form of a word (e.g. Ext.util.Inflector.singularize('words') returns 'word') @param {String} word The word to singularize @return {String} The singularized form of the word

Properties

Name Description
singleton Begin Definitions
© Copyright 2005-2011 SharpKit. All rights reserved.