Class: EmailInquire::Validator::CountryCodeTld
- Defined in:
- lib/email_inquire/validator/country_code_tld.rb
Constant Summary collapse
- COUNTRY_CODE_TLDS =
[ # TLD, generic com, all generic, registration with TLD only is possible ["jp", "co", load_data("country_code_tld/jp").freeze, true].freeze, ["uk", "co", load_data("country_code_tld/uk").freeze, true].freeze, ["br", "com", load_data("country_code_tld/br").freeze, true].freeze, ].freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(email) ⇒ CountryCodeTld
constructor
A new instance of CountryCodeTld.
- #validate ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(email) ⇒ CountryCodeTld
Returns a new instance of CountryCodeTld.
18 19 20 21 22 |
# File 'lib/email_inquire/validator/country_code_tld.rb', line 18 def initialize(email) super(email) *@rest, @sld, @tld = domain.split(".") end |
Instance Method Details
#validate ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/email_inquire/validator/country_code_tld.rb', line 24 def validate Helper.first_value( COUNTRY_CODE_TLDS ) do |cctld, generic_com, all_generics, registration_with_cctld| validate_cctld(cctld, generic_com, all_generics, registration_with_cctld) end end |