Module: ITU::E164

Defined in:
lib/itu/e164.rb,
lib/itu/e164/result.rb,
lib/itu/e164/checker.rb,
lib/itu/e164/version.rb,
lib/itu/e164/data/v2026.rb,
lib/itu/e164/invalid_number.rb,
lib/itu/e164/validation_error.rb

Defined Under Namespace

Modules: Data Classes: Checker, InvalidNumber, Result, ValidationError

Constant Summary collapse

STANDARD_VERSION =
"02/2026"
PROFILE =
:geographic
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.check(input, profile: PROFILE) ⇒ Object



14
15
16
# File 'lib/itu/e164.rb', line 14

def check(input, profile: PROFILE)
  Checker.new(profile:).call(input)
end

.check!(input, profile: PROFILE) ⇒ Object

Raises:



18
19
20
21
22
23
# File 'lib/itu/e164.rb', line 18

def check!(input, profile: PROFILE)
  result = check(input, profile:)
  raise InvalidNumber, result unless result.conformant?

  result
end

.conformant?(input, profile: PROFILE) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/itu/e164.rb', line 25

def conformant?(input, profile: PROFILE)
  check(input, profile:).conformant?
end