Module: PicoPhone
- Defined in:
- lib/pico_phone/phone_number.rb,
lib/pico_phone.rb,
lib/pico_phone/version.rb
Overview
Not loaded at runtime — exists only for YARD and IDE tooling. All methods are defined in ext/pico_phone/pico_phone.cpp via Rice.
Defined Under Namespace
Classes: Error, PhoneNumber
Constant Summary collapse
- VERSION =
"0.3.0"
Class Method Summary collapse
-
.convert_alpha_characters(string) ⇒ String
Convert vanity number alpha characters to digits (e.g. "1-800-FLOWERS" → "1-800-3569377").
- .emergency_number?(string, region) ⇒ Boolean
- .example_number(region) ⇒ PhoneNumber
- .example_number_for_type(region, type) ⇒ PhoneNumber
-
.parse(string, region = nil) ⇒ PhoneNumber
Parse a phone number string into a PhoneNumber object.
- .possible?(string) ⇒ Boolean
-
.possible_countries(string) ⇒ Array<String>
Regions that could own this number based on length or pattern.
- .possible_for_country?(string, region) ⇒ Boolean
-
.short_number_cost(string, region) ⇒ Symbol
:toll_free, :standard_rate, :premium_rate, or :unknown_cost.
- .short_number_valid?(string, region) ⇒ Boolean
-
.supported_regions ⇒ Array<String>
All region codes the library knows about (~245 in libphonenumber 9.x).
- .supported_types_for_region(region) ⇒ Array<Symbol>
- .valid?(string) ⇒ Boolean
-
.valid_countries(string) ⇒ Array<String>
Regions for which this number passes strict pattern validation.
- .valid_for_country?(string, region) ⇒ Boolean
Class Method Details
.convert_alpha_characters(string) ⇒ String
Convert vanity number alpha characters to digits (e.g. "1-800-FLOWERS" → "1-800-3569377").
|
|
# File 'lib/pico_phone/phone_number.rb', line 73
|
.emergency_number?(string, region) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 54
|
.example_number_for_type(region, type) ⇒ PhoneNumber
|
|
# File 'lib/pico_phone/phone_number.rb', line 49
|
.parse(string, region = nil) ⇒ PhoneNumber
Parse a phone number string into a PhoneNumber object.
|
|
# File 'lib/pico_phone/phone_number.rb', line 7
|
.possible?(string) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 17
|
.possible_countries(string) ⇒ Array<String>
Regions that could own this number based on length or pattern.
|
|
# File 'lib/pico_phone/phone_number.rb', line 31
|
.possible_for_country?(string, region) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 26
|
.short_number_cost(string, region) ⇒ Symbol
Returns :toll_free, :standard_rate, :premium_rate, or :unknown_cost.
|
|
# File 'lib/pico_phone/phone_number.rb', line 64
|
.short_number_valid?(string, region) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 59
|
.supported_regions ⇒ Array<String>
All region codes the library knows about (~245 in libphonenumber 9.x).
|
|
# File 'lib/pico_phone/phone_number.rb', line 69
|
.supported_types_for_region(region) ⇒ Array<Symbol>
|
|
# File 'lib/pico_phone/phone_number.rb', line 41
|
.valid?(string) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 13
|
.valid_countries(string) ⇒ Array<String>
Regions for which this number passes strict pattern validation.
|
|
# File 'lib/pico_phone/phone_number.rb', line 36
|
.valid_for_country?(string, region) ⇒ Boolean
|
|
# File 'lib/pico_phone/phone_number.rb', line 21
|