Word utilities to help map class names to tables and fields.
The Inflector
provides for transforming a ClassName into
underscored, humanized or camel-cased forms and vice-versa. It also includes
support for converting to and between singular and plural forms for common
words.
Example
Some common examples
Inflector.underscore("ActionScript"); // "action_script"
Inflector.pluralize("Post"); // "Posts"
The default mapping of a model class to its table
Inflector.underscore(Inflector.pluralize(className));
protected static var pluralRules:Array
protected static var singularRules:Array
public static function camelize(word:String):String
Camelizes an underscored phrase
Parameters
Returns
public static function humanize(word:String, capitalize:Boolean = false):String
Returns a the phrase as it would be read with spaces, optionally capitalizing the first
character in each word
Parameters
| word:String |
|
| capitalize:Boolean (default = false )
|
Returns
public static function lowerFirst(phrase:String):String
Returns a phrase with only the first character lowercased
Parameters
Returns
public static function lowerWords(phrase:String):String
Returns a phrase with all the words in it not capitalized
Parameters
Returns
public static function pluralize(word:String):String
Returns the plural version of a word
Parameters
Returns
public static function singularize(word:String):String
Gives back the singular version of a plural word
Parameters
Returns
public static function underscore(word:String):String
Returns the underscore version of a phrase
Parameters
Returns
public static function upperFirst(phrase:String):String
Returns a phrase with only the first character capitalized
Parameters
Returns
public static function upperWords(phrase:String):String
Returns a phrase with all the words in it capitalized
Parameters
Returns