Dogma.Util.Name

Utility functions for analysing names.

Source

Summary

probably_not_pascal_case?(name)

Returns true if the name is (probably) not PascalCase

probably_not_snake_case?(name)

Returns true if the name is (probably) not snake_case

probably_pascal_case?(name)

Returns true if the name is (probably) PascalCase

probably_snake_case?(name)

Returns true if the name is (probably) snake_case

Functions

probably_not_pascal_case?(name)

Returns true if the name is (probably) not PascalCase

iex> Dogma.Util.Name.probably_not_pascal_case?( "FooBar" )
false

iex> Dogma.Util.Name.probably_not_pascal_case?( "fooBar" )
true

iex> Dogma.Util.Name.probably_not_pascal_case?( "foo_bar" )
true
Source
probably_not_snake_case?(name)

Returns true if the name is (probably) not snake_case

iex> Dogma.Util.Name.probably_not_snake_case?( "foo_bar" )
false

iex> Dogma.Util.Name.probably_not_snake_case?( "fooBar" )
true
Source
probably_pascal_case?(name)

Returns true if the name is (probably) PascalCase

iex> Dogma.Util.Name.probably_pascal_case?( "FooBar" )
true

iex> Dogma.Util.Name.probably_pascal_case?( "fooBar" )
false

iex> Dogma.Util.Name.probably_pascal_case?( "foo_bar" )
false
Source
probably_snake_case?(name)

Returns true if the name is (probably) snake_case

iex> Dogma.Util.Name.probably_snake_case?( "foo_bar" )
true

iex> Dogma.Util.Name.probably_snake_case?( "fooBar" )
false
Source