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
30 31 32 33 |
# File 'lib/phonelib/phone_extended_data.rb', line 30 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
14 15 16 17 |
# File 'lib/phonelib/phone_extended_data.rb', line 14 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
22 23 24 25 |
# File 'lib/phonelib/phone_extended_data.rb', line 22 def timezone get_ext_name Phonelib::Core::EXT_TIMEZONES, Phonelib::Core::EXT_TIMEZONE_KEY end |
#valid_country_name ⇒ Object
returns valid country name
36 37 38 39 40 |
# File 'lib/phonelib/phone_extended_data.rb', line 36 def valid_country_name return unless valid? Phonelib.phone_ext_data[Phonelib::Core::EXT_COUNTRY_NAMES][valid_country] end |