Skip to content

Documentation


Documentation / @blazetrails/activesupport / Inflections

Class: Inflections ​

Defined in: packages/activesupport/lib/inflector/inflections.ts:45

Constructors ​

Constructor ​

new Inflections(): Inflections

Defined in: packages/activesupport/lib/inflector/inflections.ts:71

Returns ​

Inflections

Properties ​

acronymRegex ​

acronymRegex: RegExp

Defined in: packages/activesupport/lib/inflector/inflections.ts:51


acronyms ​

acronyms: Map<string, string>

Defined in: packages/activesupport/lib/inflector/inflections.ts:50


acronymsCamelizeRegex ​

acronymsCamelizeRegex: RegExp

Defined in: packages/activesupport/lib/inflector/inflections.ts:52


acronymsUnderscoreRegex ​

acronymsUnderscoreRegex: RegExp

Defined in: packages/activesupport/lib/inflector/inflections.ts:53


humans ​

humans: HumanRule[]

Defined in: packages/activesupport/lib/inflector/inflections.ts:49


plurals ​

plurals: InflectionRule[]

Defined in: packages/activesupport/lib/inflector/inflections.ts:46


singulars ​

singulars: InflectionRule[]

Defined in: packages/activesupport/lib/inflector/inflections.ts:47


uncountables ​

uncountables: Uncountables

Defined in: packages/activesupport/lib/inflector/inflections.ts:48

Methods ​

acronym() ​

acronym(word): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:141

Parameters ​

ParameterType
wordstring

Returns ​

void


clear() ​

clear(scope?): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:166

Parameters ​

ParameterTypeDefault value
scope"plurals" | "singulars" | "uncountables" | "humans" | "acronyms" | "all""all"

Returns ​

void


human() ​

human(rule, replacement): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:162

Parameters ​

ParameterType
rulestring | RegExp
replacementstring

Returns ​

void

Missing Rails Call ​

prepend — PERMANENT


initializeDup() ​

initializeDup(orig): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:80

Parameters ​

ParameterType
origInflections

Returns ​

void


irregular() ​

irregular(singular, plural): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:111

Parameters ​

ParameterType
singularstring
pluralstring

Returns ​

void


plural() ​

plural(rule, replacement): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:92

Parameters ​

ParameterType
rulestring | RegExp
replacementstring

Returns ​

void

Missing Rails Call ​

prepend — PERMANENT


singular() ​

singular(rule, replacement): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:102

Parameters ​

ParameterType
rulestring | RegExp
replacementstring

Returns ​

void

Missing Rails Call ​

prepend — PERMANENT


uncountable() ​

uncountable(...words): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:137

Parameters ​

ParameterType
...words(string | string[])[]

Returns ​

void


clear() ​

static clear(locale?): void

Defined in: packages/activesupport/lib/inflector/inflections.ts:87

Parameters ​

ParameterTypeDefault value
localestring"en"

Returns ​

void


instance() ​

static instance(locale?): Inflections

Defined in: packages/activesupport/lib/inflector/inflections.ts:57

Parameters ​

ParameterTypeDefault value
localestring"en"

Returns ​

Inflections


instanceOrFallback() ​

static instanceOrFallback(locale): Inflections

Defined in: packages/activesupport/lib/inflector/inflections.ts:64

Parameters ​

ParameterType
localestring

Returns ​

Inflections