View Source AbaValidator.Utils (ABA Validator v1.0.0)
Documentation for AbaValidator.Utils
.
Link to this section Summary
Functions
Checks if the length of the string matches to the defined 'n' value
Checks if the string is empty
Checks if the string is a valid bsb format
Checks if the date string is valid. If a year prefix is not provided then it will consider it as first two digits of the current year
Link to this section Functions
Checks if the length of the string matches to the defined 'n' value
examples
Examples
iex> AbaValidator.Utils.correct_length?(1)
:error
iex> AbaValidator.Utils.correct_length?("", false)
:error
iex> AbaValidator.Utils.correct_length?("11")
false
iex> AbaValidator.Utils.correct_length?("01",2)
true
iex> AbaValidator.Utils.correct_length?(" " ,1 )
true
Checks if the string is empty
examples
Examples
iex> AbaValidator.Utils.string_empty?(1)
:error
iex> AbaValidator.Utils.string_empty?("11")
false
iex> AbaValidator.Utils.string_empty?(" " )
true
Checks if the string is a valid bsb format
examples
Examples
iex> AbaValidator.Utils.valid_bsb?(1)
false
iex> AbaValidator.Utils.valid_bsb?("123 231")
false
iex> AbaValidator.Utils.valid_bsb?("123-2a1")
false
iex> AbaValidator.Utils.valid_bsb?("11")
false
iex> AbaValidator.Utils.valid_bsb?("123-312" )
true
Checks if the date string is valid. If a year prefix is not provided then it will consider it as first two digits of the current year
examples
Examples
iex> AbaValidator.Utils.valid_date?(1)
:error
iex> AbaValidator.Utils.valid_date?("11")
:error
iex> AbaValidator.Utils.valid_date?(" ")
:error
iex> AbaValidator.Utils.valid_date?("")
:error
iex> AbaValidator.Utils.valid_date?("123231")
false
iex> AbaValidator.Utils.valid_date?("120423")
true