Class Inflector

Index

Properties

Methods

Properties

public static self: IClass

[Property] (Ext.Class)

Methods

public static callOverridden(args?: any): any

[Method] Call the original method that was previously overridden with override This method is deprecated as callParent does

Parameters

  • args?: any optional

    Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callOverridden(arguments)

Returns

any

Object Returns the result of calling the overridden method

public static callParent(args?: any): any

[Method] Call the parent method of the current method

Parameters

  • args?: any optional

    Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callParent(arguments)

Returns

any

Object Returns the result of calling the parent method

public static callSuper(args?: any): any

[Method] This method is used by an override to call the superclass method but bypass any overridden method

Parameters

  • args?: any optional

    Array/Arguments The arguments, either an array or the arguments object from the current method, for example: this.callSuper(arguments)

Returns

any

Object Returns the result of calling the superclass method

public static classify(word?: string): string

[Method] Returns the correct Model name for a given string

Parameters

  • word?: string optional

    String The word to classify

Returns

string

String The classified version of the word

public static clearPlurals()

[Method] Removes all registered pluralization rules

public static clearSingulars()

[Method] Removes all registered singularization rules

public static destroy()

[Method]

public static getInitialConfig(name?: string): any

[Method] Returns the initial configuration passed to constructor

Parameters

  • name?: string optional

    String When supplied, value for particular configuration option is returned, otherwise the full config object is returned.

Returns

any

Object/Mixed

public static initConfig(instanceConfig?: any): any

[Method] Initialize configuration for this class

Parameters

  • instanceConfig?: any optional

    Object

Returns

any

Object mixins The mixin prototypes as key - value pairs

public static isTransnumeral(word?: string): boolean

[Method] Returns true if the given word is transnumeral the word is its own singular and plural form e g

Parameters

  • word?: string optional

    String The word to test

Returns

boolean

Boolean True if the word is transnumeral

public static ordinalize(number?: number): string

[Method] Ordinalizes a given number by adding a prefix such as st nd rd or th based on the last digit of the number

Parameters

  • number?: number optional

    Number The number to ordinalize

Returns

string

String The ordinalized number

public static plural(matcher?: RegExp, replacer?: string)

[Method] Adds a new pluralization rule to the Inflector

Parameters

  • matcher?: RegExp optional

    RegExp The matcher regex

  • replacer?: string optional

    String The replacement string, which can reference matches from the matcher argument

public static pluralize(word?: string): string

[Method] Returns the pluralized form of a word e g

Parameters

  • word?: string optional

    String The word to pluralize

Returns

string

String The pluralized form of the word

public static singular(matcher?: RegExp, replacer?: string)

[Method] Adds a new singularization rule to the Inflector

Parameters

  • matcher?: RegExp optional

    RegExp The matcher regex

  • replacer?: string optional

    String The replacement string, which can reference matches from the matcher argument

public static singularize(word?: string): string

[Method] Returns the singularized form of a word e g

Parameters

  • word?: string optional

    String The word to singularize

Returns

string

String The singularized form of the word

public static statics(): IClass

[Method] Get the reference to the class from which this object was instantiated

Returns

IClass

Ext.Class