Inflex v1.8.0 Inflex

Summary

Functions

Camelizes or pascalizes strings and atoms

See Inflex.Camelize.camelize/2

Inflect on the plurality of a word given some count

Converts an integer to a ordinal value

Parameterize a string given some separator

See Inflex.Parameterize.parameterize/2

Pluralize a word

Singularize a word

Underscore and lowercase a string

Functions

camelize(word)

Camelizes or pascalizes strings and atoms.

Examples

iex> Inflex.camelize(:upper_camel_case)
"UpperCamelCase"

iex> Inflex.camelize("pascal-case", :lower)
"pascalCase"
camelize(word, option)

See Inflex.Camelize.camelize/2.

inflect(word, count)

Inflect on the plurality of a word given some count.

Examples

iex> Inflex.inflect("child", 1)
"child"

iex> Inflex.inflect("child", 2)
"children"
ordinalize(number)

Converts an integer to a ordinal value.

Examples

iex> Inflex.ordinalize(1)
"1st"

iex> Inflex.ordinalize(11)
"11th"
parameterize(word)

Parameterize a string given some separator.

Examples

iex> Inflex.parameterize("String for parameter")
"string-for-parameter"

iex> Inflex.parameterize("String with underscore", "_")
"string_with_underscore"
parameterize(word, option)

See Inflex.Parameterize.parameterize/2.

pluralize(word)

Pluralize a word.

Examples

iex> Inflex.pluralize("dog")
"dogs"

iex> Inflex.pluralize("person")
"people"
singularize(word)

Singularize a word.

Examples

iex> Inflex.singularize("dogs")
"dog"

iex> Inflex.singularize("people")
"person"
underscore(word)

Underscore and lowercase a string.

Examples

iex> Inflex.underscore("UpperCamelCase")
"upper_camel_case"

iex> Inflex.underscore(:pascalCase)
"pascal_case"