Module: Phonelib::PhoneExtendedData
- Included in:
- Phone
- Defined in:
- lib/phonelib/phone_extended_data.rb
Overview
module provides extended data methods for parsed phone
Constant Summary collapse
- EXT_KEYS =
[ Phonelib::Core::EXT_GEO_NAME_KEY, Phonelib::Core::EXT_TIMEZONE_KEY, Phonelib::Core::EXT_CARRIER_KEY ]
Instance Method Summary collapse
-
#carrier ⇒ String|nil
Returns carrier of parsed phone number or nil if number is invalid or there is no carrier specified in db for this number.
-
#geo_name ⇒ String|nil
Returns geo name of parsed phone number or nil if number is invalid or there is no geo name specified in db for this number.
-
#timezone ⇒ String|nil
Returns timezone of parsed phone number or nil if number is invalid or there is no timezone specified in db for this number.
-
#valid_country_name ⇒ Object
returns valid country name.
Instance Method Details
#carrier ⇒ String|nil
Returns carrier of parsed phone number or nil if number is invalid or there is no carrier specified in db for this number
32 33 34 35 |
# File 'lib/phonelib/phone_extended_data.rb', line 32 def carrier get_ext_name Phonelib::Core::EXT_CARRIERS, Phonelib::Core::EXT_CARRIER_KEY end |
#geo_name ⇒ String|nil
Returns geo name of parsed phone number or nil if number is invalid or there is no geo name specified in db for this number
16 17 18 19 |
# File 'lib/phonelib/phone_extended_data.rb', line 16 def geo_name get_ext_name Phonelib::Core::EXT_GEO_NAMES, Phonelib::Core::EXT_GEO_NAME_KEY end |
#timezone ⇒ String|nil
Returns timezone of parsed phone number or nil if number is invalid or there is no timezone specified in db for this number
24 25 26 27 |
# File 'lib/phonelib/phone_extended_data.rb', line 24 def timezone get_ext_name Phonelib::Core::EXT_TIMEZONES, Phonelib::Core::EXT_TIMEZONE_KEY end |
#valid_country_name ⇒ Object
returns valid country name
38 39 40 41 42 |
# File 'lib/phonelib/phone_extended_data.rb', line 38 def valid_country_name return unless valid? Phonelib.phone_ext_data[Phonelib::Core::EXT_COUNTRY_NAMES][valid_country] end |